Per-application and per-environment configuration and settings for Django
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



- Check out the appsconfig/ directory in the root of your Django tree.
- Create a "conf/" directory in the root of your Django tree.
- Under "conf/", create one directory per environment.  The default
  environment is "local".
- For each application, create a "(app).conf" configuration file.
- Default values for applications go in "conf/default/(app).conf"
- Each environment can create a file that will execute
  after the root
- You can load a different environment by running:
  ENV=production python runserver
- Variables that can be used in the configuration files:
  - environment: the directory of the environment being loaded
- In the root, load the config with:

# load configuration
from config import config
if config.settings():
CONFIG = config.load()

- In an application, access the config with:
from settings import CONFIG
CONFIG.get('myapp', 'myvar')