出现异常:配置不正确



我在尝试调试代码时出现此错误:

Exception has occurred: 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.
File "C:PyProjectsInstaDriverusers_appviews.py", line 2, in <module>
from django.contrib.auth.forms import UserCreationForm

错误停止我的代码如下:

在此处输入图像描述

你从错误的地方启动了你的应用程序,你的起点应该是manage.py,vscode的默认行为是你的案例视图中的当前文件.py

最新更新