完整报错内容:
django.core.exceptions.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.
解决办法:
找到Pycharm软件右上角(如下图),选择带有dj样式的项目,点击运行就解决了。