设置django-allauth 404错误?

Ram*_*bah 7 authentication django twitter facebook oauth

我想让django-allauth为一个项目工作.在我的Django项目中,我们称之为yali,我做了一个git clone.

然后我将文件夹/ django-allauth/allauth移动到root/yali.然后删除django-allauth和所有许可证,自述文件......等

根据文档,我应该做三件事:

我应该将它添加到settings.py:

    TEMPLATE_CONTEXT_PROCESSORS = (
    ...
    "allauth.context_processors.allauth",
    "allauth.account.context_processors.account"
)

AUTHENTICATION_BACKENDS = (
    ...
    "allauth.account.auth_backends.AuthenticationBackend",
)

INSTALLED_APPS = (
    ...
    'emailconfirmation',
    'uni_form',

    'allauth',
    'allauth.account',
    'allauth.socialaccount',
    'allauth.twitter',
    'allauth.openid',
    'allauth.facebook',
Run Code Online (Sandbox Code Playgroud)

然后将其添加到urls.py

(r'^accounts/', include('allauth.urls')))
Run Code Online (Sandbox Code Playgroud)

这样做,导航到http:// localhost:8000/account时给我404

我在这里错过了什么?文档在这里有点不清楚,甚至可能是错误的.它指示将urls.py指向"帐户",而没有"帐户"文件夹但是"帐户"

man*_*nji 4

文件夹名称与 url 无关。您的应用程序的URL在 中定义urls.py。您可以输入您想要的内容,但在浏览器中导航时必须使用相同的网址。

对于您的情况,您必须导航至:

http://localhost:8000/accounts
Run Code Online (Sandbox Code Playgroud)

如果您将 url 定义为:

(r'^anything/', include('allauth.urls')))
Run Code Online (Sandbox Code Playgroud)

您应该导航到:

http://localhost:8000/anything
Run Code Online (Sandbox Code Playgroud)