您现在的位置是:课程教程文章

pycharm不支持django的解决方法

2023-12-18 17:51课程教程文章 人已围观

不支持现象:

django.core.exceptions.ImproperlyConfigured: Requested setting CACHES, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MOD

解决办法如下:

1.在需要执行的程序中添加:

import django

django.setup()

p1.jpg

2.在pycharm的设置中设置settings路径即可(app.settings)

p2.jpg

更多Python知识,请点击Python视频教程!!

课程教程:pycharm不支持django的解决方法

上一篇:pycharm中引入包失败

下一篇:没有了

站点信息

  • 文章统计篇文章