settings: Read more from environment variables.
This commit is contained in:
parent
0caf8a71c2
commit
f2cb50a848
1 changed files with 3 additions and 5 deletions
|
@ -6,7 +6,7 @@ PROJECT_ROOT = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir
|
||||||
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
|
PACKAGE_ROOT = os.path.abspath(os.path.dirname(__file__))
|
||||||
BASE_DIR = PACKAGE_ROOT
|
BASE_DIR = PACKAGE_ROOT
|
||||||
|
|
||||||
DEBUG = bool(int(os.environ.get("DEBUG", "1")))
|
DEBUG = bool(int(os.environ.get("DJANGO_DEBUG", "1")))
|
||||||
|
|
||||||
DATABASES = {
|
DATABASES = {
|
||||||
"default": {
|
"default": {
|
||||||
|
@ -24,7 +24,7 @@ import dj_database_url
|
||||||
db_from_env = dj_database_url.config()
|
db_from_env = dj_database_url.config()
|
||||||
DATABASES['default'].update(db_from_env)
|
DATABASES['default'].update(db_from_env)
|
||||||
|
|
||||||
ALLOWED_HOSTS = [".localhost", ".herokuapp.com", ".northbaypython.org", "127.0.0.1"]
|
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS", "localhost").split()
|
||||||
CANONICAL_HOST = os.environ.get("DJANGO_CANONICAL_HOST", None)
|
CANONICAL_HOST = os.environ.get("DJANGO_CANONICAL_HOST", None)
|
||||||
|
|
||||||
# If DEFAULT_FROM_EMAIL is not set, email will most likely break in prod.
|
# If DEFAULT_FROM_EMAIL is not set, email will most likely break in prod.
|
||||||
|
@ -35,7 +35,6 @@ if from_email is not None:
|
||||||
|
|
||||||
THEME_CONTACT_EMAIL = os.environ.get("THEME_CONTACT_EMAIL", None)
|
THEME_CONTACT_EMAIL = os.environ.get("THEME_CONTACT_EMAIL", None)
|
||||||
|
|
||||||
|
|
||||||
# Local time zone for this installation. Choices can be found here:
|
# Local time zone for this installation. Choices can be found here:
|
||||||
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
# http://en.wikipedia.org/wiki/List_of_tz_zones_by_name
|
||||||
# although not all choices may be available on all operating systems.
|
# although not all choices may be available on all operating systems.
|
||||||
|
@ -43,8 +42,7 @@ THEME_CONTACT_EMAIL = os.environ.get("THEME_CONTACT_EMAIL", None)
|
||||||
# timezone as the operating system.
|
# timezone as the operating system.
|
||||||
# If running in a Windows environment this must be set to the same as your
|
# If running in a Windows environment this must be set to the same as your
|
||||||
# system time zone.
|
# system time zone.
|
||||||
TIME_ZONE = os.environ.get("TZ", "America/Los_Angeles")
|
TIME_ZONE = os.environ.get("TZ")
|
||||||
|
|
||||||
|
|
||||||
# Set the email address that will receive errors.
|
# Set the email address that will receive errors.
|
||||||
admin_email = os.environ.get("DJANGO_ADMIN_EMAIL", None)
|
admin_email = os.environ.get("DJANGO_ADMIN_EMAIL", None)
|
||||||
|
|
Loading…
Add table
Reference in a new issue