B
B
bubaley2020-04-28 22:45:00
Django
bubaley, 2020-04-28 22:45:00

How to set up split manage.py between dev and prod development?

Hello, published Django on VDS using gunicorn and wsgi everything works in production. wsgi immediately contains the path to settings/prod.py (it imports the base settings). In wsgi on the local machine, I immediately set the path to prod and do not access them anymore.
But since settings/dev.py is used in manage.py on the local, and in settings/prod.py you have to change them or transfer keys.
Can this be avoided so that, depending on the development environment, it automatically understands when to take the dev / prod settings.

I thought to set a parameter in .env and change it depending on it, but maybe there are more convenient options. What are you using?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Gornostaev, 2020-04-29
@bubaley

Standard practice is to import local_settings.py from settings.py, which has different settings on different paths.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question