Django 项目“配置不当:请求的设置已安装的应用程序”错误
我需要帮助来解决当我尝试使用 Django 代码运行任何 python 脚本时引发的错误。这是错误:****PS C:\Users\pebr6\Desktop\tutorial> & c:/Users/pebr6/Desktop/pythonEnvironments/1.0/Scripts/Activate.ps1(1.0) PS C:\Users\pebr6\Desktop\tutorial> & c:/Users/pebr6/Desktop/pythonEnvironments/1.0/Scripts/python.exe c:/Users/pebr6/Desktop/tutorial/aplicaciones/principal/models.pyTraceback (most recent call last): File "c:/Users/pebr6/Desktop/tutorial/aplicaciones/principal/models.py", line 5, in <module> class Person(models.Model): File "C:\Users\pebr6\Desktop\pythonEnvironments\1.0\lib\site-packages\django\db\models\base.py", line 107, in __new__ app_config = apps.get_containing_app_config(module) File "C:\Users\pebr6\Desktop\pythonEnvironments\1.0\lib\site-packages\django\apps\registry.py", line 252, in get_containing_app_config self.check_apps_ready() File "C:\Users\pebr6\Desktop\pythonEnvironments\1.0\lib\site-packages\django\apps\registry.py", line 134, in check_apps_ready settings.INSTALLED_APPS File "C:\Users\pebr6\Desktop\pythonEnvironments\1.0\lib\site-packages\django\conf\__init__.py", line 76, in __getattr__ self._setup(name) File "C:\Users\pebr6\Desktop\pythonEnvironments\1.0\lib\site-packages\django\conf\__init__.py", line 57, in _setup raise ImproperlyConfigured(django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before acces**sing settings.******我的项目结构如下:项目结构这是我在 settings.py 上的应用程序配置:
查看完整描述