所以,昨天當我編碼時一切都很好但現(xiàn)在每當我運行命令時 -python manage.py runserver出現(xiàn)此錯誤 -Traceback (most recent call last):File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\core\management\base.py", line 328, in run_from_argv self.execute(*args, **cmd_options) File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 60, in execute super().execute(*args, **options) File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\core\management\base.py", line 369, in execute output = self.handle(*args, **options) File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\core\management\commands\runserver.py", line 67, in handle if not settings.DEBUG and not settings.ALLOWED_HOSTS: File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\conf\__init__.py", line 76, in __getattr__ self._setup(name) File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\conf\__init__.py", line 63, in _setup self._wrapped = Settings(settings_module) File "C:\Users\LENOVO\anaconda3\lib\site-packages\django\conf\__init__.py", line 142, in __init__ mod = importlib.import_module(self.SETTINGS_MODULE) File "C:\Users\LENOVO\anaconda3\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 965, in _find_and_load_unlockedModuleNotFoundError: No module named 'editdojo_project.settings'During handling of the above exception, another exception occurred:Traceback (most recent call last): File "manage.py", line 21, in <module> main() File "manage.py", line 17, in main execute_from_command_line(sys.argv)我不知道這個錯誤是什么意思,另一個問題是我可以在不運行 runserverpython manage.py命令的情況下查看我的網(wǎng)站,這真的很奇怪,因為如果我們在不運行 runserverpython manage.py命令的情況下運行它,它通常會顯示 404 頁面未找到錯誤。
1 回答

桃花長相依
TA貢獻1860條經(jīng)驗 獲得超8個贊
如果您打開錯誤的路徑來運行 manage.py 模塊,則可能會發(fā)生這種情況,另一個原因可能是您的根路徑中缺少 __ init __.py 模塊
添加回答
舉報
0/150
提交
取消