【发布时间】:2022-12-07 15:53:46
【问题描述】:
我昨晚午夜左右启动并运行了我的 django,当我关闭时一切都是卡瓦,但在早上当我打开我的电脑时我得到 django.core.exceptions.ImproperlyConfigured: error
!错误
Note that only Django core commands are listed as settings are not properly configured (error: 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.).
我尝试关闭 VScode 和终端,重新打开它们,再次启动虚拟环境,但错误仍然存在
\env\Scripts\python.exe: No module named django
我在虚拟环境中安装了 django 并设置为全局环境变量 提前致谢
我希望 python 能够在虚拟环境中安装 django
【问题讨论】:
-
显然你还没有在 virtualenv 上安装 Django。尝试
\env\scripts\python.exe -m pip freeze并确认是否列出了 Django。
标签: django django-rest-framework environment-variables virtualenv django-settings