How can I correctly set DJANGO_SETTINGS_MODULE for my Django project (I am using virtualenv)?

后端 未结 7 1664
误落风尘
误落风尘 2020-12-07 21:22

I am having some trouble setting the DJANGO_SETTINGS_MODULE for my Django project.

I have a directory at ~/dev/django-project. In this directory I have

7条回答
  •  情深已故
    2020-12-07 21:38

    I know there are plenty answers, but this one worked for me just for the record.

    1. Navigate to your .virtual_env folder where all the virtual environments are.
    2. Go to the environment folder specific to your project
    3. Append export DJANGO_SETTINGS_MODULE=.settings or export DJANGO_SETTINGS_MODULE=.settings.local if you are using a separate settings file stored in a settings folder.

提交回复
热议问题