找不到页面 accounts/signup django allauth
Page not found accounts/signup django allauth
我正在尝试将 django-allauth 合并到我的项目中。到目前为止安装一切顺利,但是当我尝试访问 'accounts/signup' 或 'accounts/login 页面时,我会自动重定向到 accounts/profile 页面未找到
这是错误:
Page not found (404)
> Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/profile/
Using the URLconf defined in dari.urls, Django tried these URL patterns, in this order:
^accounts/ ^ ^signup/$ [name='account_signup']
^accounts/ ^ ^login/$ [name='account_login']
^accounts/ ^ ^logout/$ [name='account_logout']
^accounts/ ^ ^password/change/$ [name='account_change_password']
^accounts/ ^ ^password/set/$ [name='account_set_password']
^accounts/ ^ ^inactive/$ [name='account_inactive']
^accounts/ ^ ^email/$ [name='account_email']
^accounts/ ^ ^confirm-email/$ [name='account_email_verification_sent']
^accounts/ ^ ^confirm-email/(?P<key>\w+)/$ [name='account_confirm_email']
^accounts/ ^ ^password/reset/$ [name='account_reset_password']
^accounts/ ^ ^password/reset/done/$ [name='account_reset_password_done']
^accounts/ ^ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
^accounts/ ^ ^password/reset/key/done/$ [name='account_reset_password_from_key_done']
^accounts/ ^social/
^$ [name='home']
^about/$ [name='about']
^contact/$ [name='contact']
^admin/
^static\/(?P<path>.*)$
The current URL, accounts/profile/, didn't match any of these.
这是我的 url
urlpatterns = [
url(r'^accounts/', include('allauth.urls')),
url(r'^$', 'profiles.views.home' , name='home'),
url(r'^about/$', 'profiles.views.about' , name='about' ),
url(r'^contact/$', 'contact.views.home' , name='contact' ),
url(r'^admin/', admin.site.urls),
]
<a href="http://django-allauth.readthedocs.io/en/latest/faq.html?highlight=LOGIN_REDIRECT_URL%20#when-i-attempt-to-login-i-run-into-a-404-on-accounts-profile" rel="noreferrer">Doc</a>
表示您需要实现 /profile/
页面或简单地
LOGIN_REDIRECT_URL = "<your url>"
所以原因是您已经登录了您的管理员配置文件。
解决方案:
转到管理页面 - >注销。
现在尝试 accounts/login/。你会得到这个页面。
我正在尝试将 django-allauth 合并到我的项目中。到目前为止安装一切顺利,但是当我尝试访问 'accounts/signup' 或 'accounts/login 页面时,我会自动重定向到 accounts/profile 页面未找到
这是错误:
Page not found (404)
> Request Method: GET
Request URL: http://127.0.0.1:8000/accounts/profile/
Using the URLconf defined in dari.urls, Django tried these URL patterns, in this order:
^accounts/ ^ ^signup/$ [name='account_signup']
^accounts/ ^ ^login/$ [name='account_login']
^accounts/ ^ ^logout/$ [name='account_logout']
^accounts/ ^ ^password/change/$ [name='account_change_password']
^accounts/ ^ ^password/set/$ [name='account_set_password']
^accounts/ ^ ^inactive/$ [name='account_inactive']
^accounts/ ^ ^email/$ [name='account_email']
^accounts/ ^ ^confirm-email/$ [name='account_email_verification_sent']
^accounts/ ^ ^confirm-email/(?P<key>\w+)/$ [name='account_confirm_email']
^accounts/ ^ ^password/reset/$ [name='account_reset_password']
^accounts/ ^ ^password/reset/done/$ [name='account_reset_password_done']
^accounts/ ^ ^password/reset/key/(?P<uidb36>[0-9A-Za-z]+)-(?P<key>.+)/$ [name='account_reset_password_from_key']
^accounts/ ^ ^password/reset/key/done/$ [name='account_reset_password_from_key_done']
^accounts/ ^social/
^$ [name='home']
^about/$ [name='about']
^contact/$ [name='contact']
^admin/
^static\/(?P<path>.*)$
The current URL, accounts/profile/, didn't match any of these.
这是我的 url
urlpatterns = [
url(r'^accounts/', include('allauth.urls')),
url(r'^$', 'profiles.views.home' , name='home'),
url(r'^about/$', 'profiles.views.about' , name='about' ),
url(r'^contact/$', 'contact.views.home' , name='contact' ),
url(r'^admin/', admin.site.urls),
]
<a href="http://django-allauth.readthedocs.io/en/latest/faq.html?highlight=LOGIN_REDIRECT_URL%20#when-i-attempt-to-login-i-run-into-a-404-on-accounts-profile" rel="noreferrer">Doc</a>
表示您需要实现 /profile/
页面或简单地
LOGIN_REDIRECT_URL = "<your url>"
所以原因是您已经登录了您的管理员配置文件。 解决方案: 转到管理页面 - >注销。 现在尝试 accounts/login/。你会得到这个页面。