Skip to main content
 首页 » 编程设计

python之Google App Engine Django 补丁中没有反向错误

2025年05月04日26lvdongjie

我正在使用 Google App Engine给 Django 打补丁。

当我尝试访问管理站点时,

http://127.0.0.1:8080/admin/

,我一直收到这个错误:

TemplateSyntaxError at /admin/ Caught an exception while rendering: Reverse for 'settings.django.contrib.auth.views.logout' with arguments '()' and keyword arguments '{}' not found.

这是全新安装,我没有做太多改动。但是我 我无法解决这个问题。

这是里面补丁自带的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'), 
) 

请您参考如下方法:

我找不到合适的答案来回答我的问题。无论如何,我通过重新安装 Django 框架和应用引擎 SDK 暂时解决了这个问题。