diff options
Diffstat (limited to 'src/laas_dashboard')
-rw-r--r-- | src/laas_dashboard/settings.py | 19 | ||||
-rw-r--r-- | src/laas_dashboard/urls.py | 3 |
2 files changed, 18 insertions, 4 deletions
diff --git a/src/laas_dashboard/settings.py b/src/laas_dashboard/settings.py index 951ce1a..62fc9ec 100644 --- a/src/laas_dashboard/settings.py +++ b/src/laas_dashboard/settings.py @@ -53,10 +53,23 @@ MIDDLEWARE = [ ROOT_URLCONF = 'laas_dashboard.urls' +TEMPLATE_OVERRIDE = os.environ.get("TEMPLATE_OVERRIDE_DIR", "") # the user's custom template dir +TEMPLATE_DIRS = ["base"] # where all the base templates are + +# If the user has a custom template directory, +# We should search that first. Then we search the +# root template directory so that we can extend the base +# templates within the custom template dir. +if TEMPLATE_OVERRIDE: + TEMPLATE_DIRS = [TEMPLATE_OVERRIDE, ""] + TEMPLATE_DIRS + +# all template dirs are relative to /project_root/templates/ +dirs = [os.path.join(BASE_DIR, "templates", d) for d in TEMPLATE_DIRS] + TEMPLATES = [ { 'BACKEND': 'django.template.backends.django.DjangoTemplates', - 'DIRS': [os.path.join(BASE_DIR, 'templates')], + 'DIRS': dirs, 'APP_DIRS': True, 'OPTIONS': { 'context_processors': [ @@ -206,5 +219,5 @@ EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD'] EMAIL_USE_TLS = True DEFAULT_EMAIL_FROM = os.environ.get('DEFAULT_EMAIL_FROM', 'webmaster@localhost') SESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies" -EXPIRE_LIFETIME = 12 # Minimum lifetime of booking to send notification -EXPIRE_HOURS = 48 # Notify when booking is expiring within this many hours +EXPIRE_LIFETIME = 12 # Minimum lifetime of booking to send notification +EXPIRE_HOURS = 48 # Notify when booking is expiring within this many hours diff --git a/src/laas_dashboard/urls.py b/src/laas_dashboard/urls.py index f90f18b..17cbe84 100644 --- a/src/laas_dashboard/urls.py +++ b/src/laas_dashboard/urls.py @@ -9,7 +9,8 @@ ############################################################################## -"""laas_dashboard URL Configuration +""" +laas_dashboard URL Configuration. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.10/topics/http/urls/ |