How to check if this is the index page in Django?
How can I check of the present page is the index page in a Django templ开发者_如何转开发ate?
{% if What Goes Here??? %}
// whatever
{% endif %}
TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.request',
...
)
{% if request.path == "/" %}
...
{% endif %}
You can just add your template code to the index page template itself.
精彩评论