使用 django-allauth 找不到页面 (404)

Page not found (404) with django-allauth

我正在尝试将 django-allauth 合并到我的项目中。到目前为止,安装一切顺利,但是当我尝试访问 'accounts' 页面时,出现 "page not found 404" 错误。

这是输出:

Using the URLconf defined in Mysite.urls, Django tried these URL patterns, in this order:
    ^$ [name='home']
    ^contact$ [name='contact']
    ^about [name='about']
    ^login/$ [name='login']
    ^logout$ [name='logout']
    ^admin/
    ^accounts/
The current URL, accounts, didn't match any of these.

这是 Mysite.urls 文件:

"""
Definition of urls for Mysite.
"""

from datetime import datetime
from django.conf.urls import patterns, url
from app.forms import BootstrapAuthenticationForm

# Uncomment the next lines to enable the admin:
from django.conf.urls import include
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'^$', 'app.views.home', name='home'),
    url(r'^contact$', 'app.views.contact', name='contact'),

    # SNIP #

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),

    # Allauth
    url(r'^accounts/', include('allauth.urls'))
)

我所做的所有事情都是在 this installation documentation 之后完成的。我基本上已经将所有内容复制粘贴到 settings.py.

这可能是什么原因? 运行 manage.py syncdb 或启动服务器时我没有收到任何错误。

allauth 没有 "index" 页面 (/accounts/)。相反,您可以访问以下页面:

/accounts/signup/
/accounts/login/

如果您在 settings.py 中设置 DEBUG = True,您将能够看到 /accounts/ 下的所有可用页面,例如: