Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CONFIG_INI = Path(os.environ.get('DJANGO_CONFIG_INI', BASE_DIR / 'config.ini'))
- if CONFIG_INI.exists():
- config = RawConfigParser()
- config.read_file(CONFIG_INI.open())
- if not config.has_section('django'):
- raise ImproperlyConfigured('Missing `django` section in environment file: %s', CONFIG_INI)
- for k,v in config.items('django'):
- e = k.upper()
- if e not in os.environ: # Don't overwrite existing
- os.environ[e] = v
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement