在我的“根”模板中,我有这样的东西
{% if special %}
some_special_html
{% endif %}
special
模板变量被某些视图插入到模板中。
问题是我需要password_change
视图来设置special
模板变量。
解决这个问题的最佳方法是什么?
目前,password_change
视图是直接从 urls.py 调用的:
url(r'^change_password/$', 'django.contrib.auth.views.password_change',
{'template_name': 'profile/password_change.html'},
name='password_change'),