在Django上找不到页面 - 空路径

问题描述 投票:0回答:1

我正在尝试运行this library。我下载并将其复制到我的桌面上,然后我尝试使用以下命令运行它:

py -3.7 manage.py runserver

我有:

Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.

但当我去那个网址时,我一直收到这个错误:

Page not found (404)
Request Method: GET
Request URL:    http://127.0.0.1:8000/
Using the URLconf defined in django_google_authenticator.urls, Django tried these URL patterns, in this order:

^admin/login/$
^admin/
The empty path didn't match any of these.

我不明白什么是错的,有人能帮帮我吗?提前致谢!

python django two-factor-authentication
1个回答
1
投票

我认为这是Django的正常行为,因为你可以看到它说你的路径与任何已配置的路径都不匹配,比如admin,所以你为什么不试试http://127.0.0.1:8000/admin/to访问Django Admin登录页面。

如果你想看到与基本网址的404不同的东西你需要configure your urls并且可能添加重定向视图,这样当使用基本网址时它将重定向到你的管理员或其他首选页面。

最新问题
© www.soinside.com 2019 - 2024. All rights reserved.