发生异常:配置不正确

2024-05-23 17:49:43 发布

您现在位置:Python中文网/ 问答频道 /正文

尝试调试代码时出现以下错误:

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:\PyProjects\InstaDriver\users_app\views.py", line 2, in <module>
    from django.contrib.auth.forms import UserCreationForm

此错误会按如下方式停止我的代码:

enter image description here


Tags: appsinstalled代码settings错误exceptionnotsetting