无法登录到管理站点。返回找不到的页

2024-10-03 21:36:07 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图在一个托管共享托管计划托管我的网站。我被告知使用cpanel创建一个virtualenv,然后使用passenger运行django。我的virtualenv文件夹和project文件夹都在根目录下。在设置了所有设置并运行collectstatic并创建了一个超级用户之后,我尝试转到django管理站点。我得到了登录页面,但是,尝试登录会导致页面找不到错误。它声明:

Page not found (404)

Request Method: POST

Request URL: https://www.website.com/admin/login/?next=/admin/

Raised by: django.contrib.admin.sites.login

Using the URLconf defined in readerspoint.urls, Django tried these URL patterns, in this order:

1) admin/

The empty path didn't match any of these.

You're seeing this error because you have DEBUG = True in your Django settings file. Change that to False, and Django will display a standard 404 page.

我仔细看了一下CPanel的错误,这里是这样写的:

WARNING: /home/username/public_html/admin/login: Can't access file /home/username/public_html/admin/login: No such file or directory

WARNING: /home/username/public_html/admin/login: Can't access file /home/username/public_html/admin/login: No such file or directory

WARNING: /home/username/public_html/admin: Can't access file /home/username/public_html/admin: No such file or directory

[ N 2018-02-28 18:53:10.6076 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 830971, application /home/username/website

[ N 2018-02-28 18:53:10.4069 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 836756, application /home/username/public_html

[ N 2018-02-28 18:53:10.4067 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 835949, application /home/username/public_html

[ N 2018-02-28 18:53:10.3932 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 836756, application /home/username/public_html

[ N 2018-02-28 18:53:10.3930 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 835949, application /home/username/public_html

[ N 2018-02-28 18:53:10.3928 766038/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 830971, application /home/username/website

[ N 2018-02-28 18:49:24.1637 766038/Tt age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 790124, application /home/username/public_html

[ N 2018-02-28 18:48:35.3971 766038/Tr age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 787169, application /home/username/website

[ N 2018-02-28 18:40:57.7578 766038/T9 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 780233, application /home/username/website

[ N 2018-02-28 18:37:16.8870 607641/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 686858, application /home/username/public_html

[ N 2018-02-28 18:37:16.8766 607641/T1 age/Cor/CoreMain.cpp:994 ]: Checking whether to disconnect long-running connections for process 686858, application /home/username/public_html

URLconf我的项目当前看起来像:

from django.contrib import admin
from django.urls import path

urlpatterns = [
    path('admin/', admin.site.urls),
]

感谢任何帮助。谢谢你


Tags: tohomeageadminhtmlusernamepublicrunning