【发布时间】:2010-10-26 16:55:18
【问题描述】:
我正在使用Google App Engine 补丁 Django。
当我尝试访问管理站点时,
,我不断收到此错误:
/admin/ 处的模板语法错误 渲染时遇到异常:Reverse for 带有参数的“settings.django.contrib.auth.views.logout” 未找到“()”和关键字参数“{}”。
这是一个全新的安装,我没有太大变化。但是我 我无法解决这个问题。
这是里面补丁自带的urls.py文件 注册应用:
urlpatterns = patterns('',
# Activation keys get matched by \w+ instead of the more specific
# [a-fA-F0-9]{40} because a bad activation key should still get to
# that way it can return a sensible "invalid key" message instead
# confusing 404.
url(r'^activate/(?P<activation_key>\w+)/$',
activate,
name='registration_activate'),
url(r'^login/$',
auth_views.login,
{'template_name': 'registration/login.html'},
name='auth_login'),
url(r'^logout/$',
auth_views.logout,
name='auth_logout'),
url(r'^password/change/$',
auth_views.password_change,
name='auth_password_change'),
url(r'^password/change/done/$',
auth_views.password_change_done,
name='auth_password_change_done'),
url(r'^password/reset/$',
auth_views.password_reset,
name='auth_password_reset'),
url(r'^password/reset/confirm/(?P<uidb36>.+)/(?P<token>.+)/$',
auth_views.password_reset_confirm,
name='auth_password_reset_confirm'),
url(r'^password/reset/complete/$',
auth_views.password_reset_complete,
name='auth_password_reset_complete'),
url(r'^password/reset/done/$',
auth_views.password_reset_done,
name='auth_password_reset_done'),
url(r'^register/$',
register,
name='registration_register'),
url(r'^register/complete/$',
direct_to_template,
{'template': 'registration/registration_complete.html'},
name='registration_complete'),
)
【问题讨论】:
-
我不知道这里发生了什么,但我认为有一个线索是它以“settings.django.contrib”开头的视图名称,这有点奇怪。你的 settings.py 中有 ROOT_URLCONF 的设置吗?
标签: python django google-app-engine django-urls