my directory structure is like this
db.pymodels
models.py:
: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 accessing settings.
and then the problem comes again. The following Times error message, this error is directly in the db.py file, import models. I wonder if it is because I introduced the models module automatically generated by django, which does not support running .py files directly, so there is a django test unit.
Traceback (most recent call last):
File "C:/Users/malloc/Desktop/pythonprj/pycharmpj/Django/myblog/blog/db.py", line 3, in <module>
import models
File "C:\Users\malloc\Desktop\pythonprj\pycharmpj\Django\myblog\blog\models.py", line 4, in <module>
class User(models.Model):
File "C:\Appsofmy\Anaconda\lib\site-packages\django\db\models\base.py", line 87, in __new__
app_config = apps.get_containing_app_config(module)
File "C:\Appsofmy\Anaconda\lib\site-packages\django\apps\registry.py", line 249, in get_containing_app_config
self.check_apps_ready()
File "C:\Appsofmy\Anaconda\lib\site-packages\django\apps\registry.py", line 131, in check_apps_ready
settings.INSTALLED_APPS
File "C:\Appsofmy\Anaconda\lib\site-packages\django\conf\__init__.py", line 57, in __getattr__
self._setup(name)
File "C:\Appsofmy\Anaconda\lib\site-packages\django\conf\__init__.py", line 44, in _setup
self._wrapped = Settings(settings_module)
File "C:\Appsofmy\Anaconda\lib\site-packages\django\conf\__init__.py", line 107, in __init__
mod = importlib.import_module(self.SETTINGS_MODULE)
File "C:\Appsofmy\Anaconda\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ModuleNotFoundError: No module named "config"
what is the situation of asking? How to solve it? I really fainted