gpt4 book ai didi

Django admin page showing PATH module not found(显示未找到路径模块的Django管理页面)

转载 作者:bug小助手 更新时间:2023-10-25 16:46:50 37 4
gpt4 key购买 nike



I am trying to access:
http://127.0.0.1:8000/admin/login/?next=/admin/
but I am shown with this error:
'''
ModuleNotFoundError at /admin/login/
No module named 'path'
Request Method: GET
Request URL: http://127.0.0.1:8000/admin/login/?next=/admin/
Django Version: 4.2.5
Exception Type: ModuleNotFoundError
Exception Value:

No module named 'path'
Exception Location: , line 1004, in _find_and_load_unlocked
Raised during: django.contrib.admin.sites.login
Python Executable: C:\Program Files\Python310\python.exe
Python Version: 3.10.6
Python Path:

['C:\Users\ROHIT\Documents\Project\hospital2\hospital_project',
'C:\Program Files\Python310\python310.zip',
'C:\Program Files\Python310\DLLs',
'C:\Program Files\Python310\lib',
'C:\Program Files\Python310',
'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages',
'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32',
'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32\lib',
'C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\Pythonwin',
'C:\Program Files\Python310\lib\site-packages']
Server time: Sun, 10 Sep 2023 08:21:55 +0000
'''

我正在尝试访问:http://127.0.0.1:8000/admin/login/?next=/admin/,但显示以下错误:/ADMIN/LOGIN/No模块名为‘Path’的模块请求方法:GET请求URL:http://127.0.0.1:8000/admin/login/?next=/admin/Django版本:4.2.5异常类型:模块名为‘Path’的异常错误值:没有名为‘Path’的模块异常位置:,第1004行,In_Find_and_Load_UNLOCKED在以下过程中引发:django.contri.admin.sites.login Python可执行文件:C:\Program Files\Python310\python.exe版本:3.10.6Python路径:[‘C:\Users\ROHIT\Documents\Project\hospital2\hospital_project’,‘C:\Program Files\Python310\Python310.zip’,‘C:\Program Files\Python310\DLLS’,‘C:\Program Files\Python310\lib’,‘C:\Program Files\Python310’,‘C:\Program Files\Python310’,‘C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages’,‘C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32’,‘C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\win32\lib’,‘C:\Users\ROHIT\AppData\Roaming\Python\Python310\site-packages\Pythonwin’,‘C:\Program Files\Python310\lib\Site-Packages’]服务器时间:Sun,2023年9月10日08:21:55+0000‘’


I have included from django.urls import path in all the urls.py

我已经在所有urls.py文件中包含了来自django.urls的导入路径。


更多回答
优秀答案推荐

Firstly, Are you sure that the path function is imported correctly? Did you check for spelling errors? If you are using a virtual environment check out if it is activated.
Secondly, Some extra information would be better to pinpoint the problem accurately. It would be helpful if you could provide the urls.py file to check it out.

首先,您确定路径函数导入正确吗?你有没有检查拼写错误?如果您使用的是虚拟环境,请检查它是否已激活。其次,一些额外的信息将更好地准确地定位问题。如果您能提供urls.py文件来签出它,那将是很有帮助的。


更多回答

I checked urls.py whether correct modules were imported it was all good and correct i just started a new project and copied my backend and it running fluently.

我检查了urls.py是否导入了正确的模块,一切正常并且正确,我刚开始一个新项目,并复制了我的后端,它运行得很流畅。

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