gpt4 book ai didi

django - 找不到页面 (404)

转载 作者:行者123 更新时间:2023-12-04 22:21:32 25 4
gpt4 key购买 nike

错误:

Request Method: GET
Request URL: http://192.168.100.10/accounts/profile/
Using the URLconf defined in urls, Django tried these URL patterns, in this order:
^collect/
^member/
^accounts/login/$
^ ^$
^ ^contact/$
^ ^privacy-statement/$
^logout/$ [name='logout']
^data-admin/doc/
^accounts/password/reset/$
^accounts/password/reset/done/$
^accounts/password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$
^accounts/password/done/$
^media/(?P<path>.*)$
The current URL, accounts/profile/, didn't match any of these.

登录后发生此错误,它正在接受用户名和密码,它应该成功转到/index/页面,但它转到帐户/配置文件/。如果我删除帐户/配置文件/并运行 ip,它将重定向到正确的网址。

应用程序网址.py
from django.conf.urls.defaults import *

urlpatterns = patterns(
'zergit.views',
(r'^$', 'index'),
)

谢谢

最佳答案

您需要更改默认的 LOGIN_REDIRECT_URL 设置

默认情况下, LOGIN_REDIRECT_URL 设置为 /accounts/profile/ 。您的 URL 中显然没有 /accounts/profile/,因此您需要指定登录成功后要重定向到的 URL。

就像是:

LOGIN_REDIRECT_URL = '/' #Or whatever you wish

关于django - 找不到页面 (404),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17407971/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com