pycharm不支持django的解决方法

412次阅读
没有评论

pycharm不支持django的解决方法

不支持现象:

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()

pycharm不支持django的解决方法

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

pycharm不支持django的解决方法

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

神龙|纯净稳定代理IP免费测试>>>>>>>>天启|企业级代理IP免费测试>>>>>>>>IPIPGO|全球住宅代理IP免费测试

相关文章:

版权声明:python工具2022-12-09发表,共计276字。
新手QQ群:570568346,欢迎进群讨论 Python51学习