debug没有报错,python manage.py runserver后
显示没有问题
System check identified no issues (0 silenced).
May 25, 2021 - 21:35:47
Django version 3.2.3, using settings None
Starting development server at http://127.0.0.1:8000/
Quit the server with CTRL-BREAK.
但是我用浏览器打开127.0.0.1后
浏览器显示
A server error occurred. Please contact the administrator.
然后我返回vscode查看,发现有了报错
Traceback (most recent call last):
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\wsgiref\handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\wsgi.py", line 133, in __call__
response = self.get_response(request)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 129, in get_response
set_urlconf(settings.ROOT_URLCONF)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\conf\__init__.py", line 83, in __getattr__
val = getattr(self._wrapped, name)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\conf\__init__.py", line 239, in __getattr__
return getattr(self.default_settings, name)
AttributeError: module 'django.conf.global_settings' has no attribute 'ROOT_URLCONF'
[25/May/2021 21:35:53] "GET / HTTP/1.1" 500 59
Traceback (most recent call last):
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\wsgiref\handlers.py", line 137, in run
self.result = application(self.environ, self.start_response)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\wsgi.py", line 133, in __call__
response = self.get_response(request)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\core\handlers\base.py", line 129, in get_response
set_urlconf(settings.ROOT_URLCONF)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\conf\__init__.py", line 83, in __getattr__
val = getattr(self._wrapped, name)
File "C:\Users\87508\AppData\Local\Programs\Python\Python39\lib\site-packages\django\conf\__init__.py", line 239, in __getattr__
return getattr(self.default_settings, name)
AttributeError: module 'django.conf.global_settings' has no attribute 'ROOT_URLCONF'
有大佬知道这个问题要怎么解决吗,在网上搜了很多,没有找到解决方法