Pypi search: at least 40 packages about "Django settings"
INSTALLED_APPS, AUTH_USER_MODEL, ...
FOOBAR_EXPIRE_DELAY, MAX_ACCOUNTS, ...
DATABASES['HOST'], ALLOWED_HOSTS, SECRET_KEY
# Import try: from . import local_settings except ImportError: pass # Exec execfile( '/etc/myproject/settings.py', globals(), )
Pros:
Cons:
# settings.py import getconf CONFIG = getconf.ConfigGetter('MYPROJ', [ '/etc/myproj/settings/', os.path.join(ROOT_DIR, 'local_settings.ini'), ]) ENVIRONMENT = CONFIG.get('ENVIRONMENT', 'dev') STATIC_URL = CONFIG.get('django.static_url', '/static/') DATABASES = {'default': { 'HOST': CONFIG.get('db.host', 'localhost'), 'PORT': CONFIG.getint('db.port', '5432'), # ... }}
Configure through INI files:
# /etc/myproj/settings/base.ini [DEFAULT] environment = prod [django] static_url = https://static.example.org/ [db] host = psql01.example.org # /etc/myproj/settings/passwords.ini [db] password = !!TopSicrit!!
Or environment variables:
export MYPROJ_DJANGO_STATIC_URL=https://static.example.org/ export MYPROJ_DB_HOST=psql01.example.org
Designed to solve a single problem:
Get environment-dependent settings in the platform-typical way.
# myapp/conf.py import appconf from django.conf import settings class MyAppConf(appconf.AppConf): MYAPP_MAX_QUERIES = 5 MYAPP_USER_MODEL = settings.AUTH_USER_MODEL
Also, we're hiring!
Table of Contents | t |
---|---|
Exposé | ESC |
Full screen slides | e |
Presenter View | p |
Source Files | s |
Slide Numbers | n |
Toggle screen blanking | b |
Show/hide slide context | c |
Notes | 2 |
Help | h |