__init__.py 932 Bytes
Newer Older
1
2
3
4
5
6
7
8
"""
Settings module

This file controls what settings are loaded.

Using environment variables you can control the loading of various
overrides.
"""
Thom Wiggers's avatar
Thom Wiggers committed
9
10
# flake8: noqa: ignore F403

11
import os
12
13
14

# Load all default settings because we need to use settings.configure
# for sphinx documentation generation.
15
from django.conf.global_settings import *  # pylint: disable=wildcard-import
16

17
18

# Load base settings
19
from .settings import *  # pylint: disable=wildcard-import
20
21

# Attempt to load local overrides
Thom Wiggers's avatar
Thom Wiggers committed
22
try:
23
    from .localsettings import *  # pylint: disable=wildcard-import
Thom Wiggers's avatar
Thom Wiggers committed
24
25
except ImportError:
    pass
Thom Wiggers's avatar
Thom Wiggers committed
26

27
28
# Load production settings if DJANGO_PRODUCTION is set
if os.environ.get('DJANGO_PRODUCTION'):  # pragma: nocover
29
    from .production import *  # pylint: disable=wildcard-import
30
31
32

# Load testing settings if GITLAB_CI is set
if os.environ.get('GITLAB_CI'):  # pragma: nocover
33
    from .testing import *  # pylint: disable=wildcard-import