Answer the question
In order to leave comments, you need to log in
How to properly store settings in a django project?
How to properly store settings in a growing django project When the project is already growing from one file with settings (settings\prod\deb\base etc.), it becomes necessary to categorize the settings into different files, depending on the environment, for example, db. py is different for prod\dev\test
There was a need for a settings manager that is easy and convenient to work with.
Are there any modules to solve such problems? Searching on https://pypi.python.org/pypi didn't turn up a good option
Answer the question
In order to leave comments, you need to log in
categorize settingsThere was never such a need
myprog
├── manage.py
└── myprog
├── __init__.py
├── settings
│ ├── __init__.py
│ ├── global.py
│ └── settings_test.py
├── urls.py
└── wsgi.py
import os
if os.environ['test']:
from settings_test.py import *
from global.py import *
foo='buzz'
your_project_root/your_project_name/settings/
├── base.py
├── development.py
├── __init__.py
├── local.py
├── production.py
└── testing.py
from .testing import *
DATABASES = ...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question