B
B
beduin012018-08-02 11:27:37
Django
beduin01, 2018-08-02 11:27:37

Should I move Django configs to ini?

What is the best way to organize a project? If I need dev and prod, how much is it better to do it? You can do two settings.py, but something tells me that this is a bad practice and you need to fill in settings.py from ini

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2018-08-02
@sim3x

No
Secret variables need to be moved to env
If you need to adjust the settings depending on the environment (dev, test, prod), then the settings file is converted into a module and several files are made inside the module for each environment that modify the main config

settings
├── dev.py
├── __init__.py
├── settings.py
└── test.py

inside __init__.py you can organize automatic detection of the environment by environment variables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question