Django You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.confi

1. When creating a new Django project today, an error was reported, and the content is as follows.

 

django.core.exceptions.ImproperlyConfigured: Requested setting DEBUG, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.

Solution:

Set up pycharm

Configure your project name + setting

File resolution

Guess you like

Origin blog.csdn.net/u012798683/article/details/107016863