Atma
Atma

Reputation: 29767

how to call different settings from manage.py in django

I'm trying to call environment specific settings in django.

I found that you can do something close in django admin according to: https://docs.djangoproject.com/en/2.0/topics/settings/#the-django-admin-utility

I tried this with the manage.py:

python3 manage.py runserver --settings=mysite.settings.prod_settings

I get the error:

ModuleNotFoundError: No module named 'mysite.settings.prod_settings'; 'mysite.settings' is not a package

How can I call environment specific settings?

Thanks

Upvotes: 2

Views: 3485

Answers (1)

Atma
Atma

Reputation: 29767

I changed the command to:

python3 manage.py runserver --settings=mysite.prod_settings

because I have a file called prod_settings.py and it worked.

Upvotes: 5

Related Questions