Views

Main views of PSKB app

pskb_website.views.all_authors(*args, **kwargs)[source]

Get listing of all authors who’ve contributed a guide

pskb_website.views.article_view(stack, title)[source]

Find article with given stack/stack combination and display it

Note all publish statuses are searched and the first one found is returned. This allows us to keep the same URL through the publish workflow process since the status is only a ‘hint’ and query string.

By default, the statuses are searched in the order of importance: published, in-review, and finally draft.

GET parameters used:
  • status: Hint on what publish status to search for FIRST
    • Default is ‘published’ which makes the published articles have clean URLs without any query string.
  • branch: Branch of article to display
    • Default is master
pskb_website.views.authorized()[source]

URL for Github auth callback

pskb_website.views.change_publish_status(*args, **kwargs)[source]

Publish or unpublish article via POST

pskb_website.views.contest()[source]

Contest page

pskb_website.views.contributors()[source]

Contributors page

pskb_website.views.delete(*args, **kwargs)[source]

Delete POST page

pskb_website.views.faq()[source]

FAQ page

pskb_website.views.get_sitemap()[source]

sitemap

pskb_website.views.get_social_redirect_url(article, share_domain)[source]

Get social redirect url for po.st to enable all counts to follow us regardless of where we’re hosted.

pskb_website.views.github_login()[source]

Callback for github oauth

pskb_website.views.in_review()[source]

In review page

pskb_website.views.index()[source]

Homepage

pskb_website.views.internal_error(error=None)[source]

Unknown error page

pskb_website.views.login()[source]

Login page

pskb_website.views.logout(*args, **kwargs)[source]

Logout page

pskb_website.views.missing_article(requested_url=None, stack=None, title=None, branch=None)[source]

Handle missing articles by checking if URL is should be 301 redirect or showing published articles in the URL is truly bad

pskb_website.views.my_drafts(*args, **kwargs)[source]

Users drafts

pskb_website.views.not_found(error=None)[source]

Not found error page

pskb_website.views.partner(article_path)[source]

URL for articles from hackhands blog – these articles are not editable.

pskb_website.views.partner_import(*args, **kwargs)[source]

Special ‘hidden’ URL to import articles to secondary repo

pskb_website.views.render_article_list_view(status)[source]

Render list of articles with given status

Parameters:status – PUBLISHED, IN_REVIEW, or DRAFT
pskb_website.views.render_article_view(request_obj, article, only_visible_by_user=None)[source]

Render article view

Parameters:
  • request_obj – Request object
  • article – Article object to render view for
  • branch – Branch of article to read
  • only_visible_by_user – Name of user that is allowed to view article or None to allow anyone to read it
pskb_website.views.render_published_articles(status_code=200)[source]

Render published article listing and featured article

This is extracted into a stand-alone function so we can render this in multiple locations without redirects which could hurt SEO and usability.

pskb_website.views.review(title)[source]

This URL only exists for legacy reasons so try to find the article where it is in the new scheme and return 301 to indicate moved.

Form POST to update featured title

pskb_website.views.strip_subfolder(url)[source]

Strip off the subfolder if it exists so we always use the exact same share url for saving counts.

pskb_website.views.subscribe()[source]

Subscribe POST page

pskb_website.views.sync_listing(*args, **kwargs)[source]

Sync listing page

pskb_website.views.template_globals()[source]

Global variables available to all responses

pskb_website.views.url_components(url)[source]

Get URL path components as a list (leading slash is removed!)

pskb_website.views.url_for_domain(url, domain=None)[source]

Get url for domain from environment

pskb_website.views.user_profile(author_name)[source]

Profile page

pskb_website.views.write(*args, **kwargs)[source]

Editor page