问题一 在使用manage.py 执行 makemigrations 迁移数据库的时候,遇到的问题如下 File "E:\virtual_workshop\auto-test-platform-NGrddHeT\lib\site-packages\django\apps\registry.py" , line 141 , in check_models_ready raise Ap
问题一
在使用manage.py 执行 makemigrations 迁移数据库的时候,遇到的问题如下
File "E:\virtual_workshop\auto-test-platform-NGrddHeT\lib\site-packages\django\apps\registry.py", line 141, in check_models_readyraise AppRegistryNotReady("Models aren't loaded yet.")
django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet
解决办法
在manage.py中加入一行代码
django.setup()问题二
继续执行 makegirations 发现报另一个错误
django.core.exceptions.ImproperlyConfigured: Requested setting LOGGING_CONFIG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.解决办法
使用python manage.py makegirations进行迁移