找不到页面(404)与django-allauth

时间:2015-03-12 18:11:01

标签: django django-allauth

我试图在我的项目中加入django-allauth。到目前为止,安装非常好,但是当我尝试访问帐户时#39;页面,我得到一个"页面未找到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或启动服务器时,我不会收到任何错误。

1 个答案:

答案 0 :(得分:4)

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

/accounts/signup/
/accounts/login/

如果您在settings.py中设置DEBUG = True,则可以看到/accounts/下的所有可用网页,例如:

enter image description here