开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜