Working with rich content¶
This section contains an in-depth discussion of the architecture and design decisions behind GLAMkit’s enterprise-level tools for working with content.
Debugging tip - finding what view is used¶
In an ecosystem as rich as GLAMkit’s, it can often be confusing to figure out which view is rendered by which URL. To track this down:
Try:
manage.py show_urls
which lists all the URL patterns with their corresponding view.
If the URL is covered by a non-obvious catch-all, then it’s probably a
Page
, as they can be mounted at any URL point. The URL for aPage
is normally its slug concatenated with the slugs of its parents, but Pages can specify any URL as inurl_override
. You can see if a Page matches by running:UrlNode.objects.get_for_path(url)
and then look at the
page_type_plugins
file; for the Page model to see what Plugin is used. Theget_response()
method of the plugin is the view.As a last resort, enable
debug_toolbar
and review the list of templates to see what is being rendered, and search the codebase for the template name to see where it is used.However, note that
Layout
objects store the template name in the database. If you see alayouts
path in your template name, there is a chance that it’s specified by aLayout
object. In that case, look in theLayout
object’s properties (or its admin) to determine which kinds of content can use that layout.