Views¶
Main views of PSKB app
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
URL for Github auth callback
-
pskb_website.views.
change_publish_status
(*args, **kwargs)[source]¶ Publish or unpublish article via POST
Get social redirect url for po.st to enable all counts to follow us regardless of where we’re hosted.
-
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.
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.
-
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.