Python 在auth_登录和auth_注销中获取RequestContext
可能重复:Python 在auth_登录和auth_注销中获取RequestContext,python,django,django-authentication,django-registration,Python,Django,Django Authentication,Django Registration,可能重复: 我正在使用django注册,它使用django.contrib.auth.views.auth_login和django.contrib.auth.views.auth_login视图提供登录和注销。但是,当它呈现my registration/login.html和registration/logout.html模板时,不包括RequestContext。在这些模板中获得RequestContext而不进行猴子补丁的最佳方法是什么?根据Alex的,添加以下内容: TEMPLATE
我正在使用django注册,它使用
django.contrib.auth.views.auth_login
和django.contrib.auth.views.auth_login
视图提供登录和注销。但是,当它呈现my registration/login.html和registration/logout.html模板时,不包括RequestContext
。在这些模板中获得RequestContext
而不进行猴子补丁的最佳方法是什么?根据Alex的,添加以下内容:
TEMPLATE_CONTEXT_PROCESSORS = (
# ... other context processors here
'django.core.context_processors.request',
)
相关: