From e97f2b8d3bb16066e7dd4558095be3a8103bdf76 Mon Sep 17 00:00:00 2001 From: rscnt Date: Wed, 20 May 2015 22:57:00 -0600 Subject: [PATCH] settings: Added TEMPLATE_DIRS tuple and MEDIA_* Signed-off-by: rscnt --- dynamicweb/settings.py | 30 ++++++++++++++++++++++++++---- media/keep | 0 static/keep | 0 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 media/keep create mode 100644 static/keep diff --git a/dynamicweb/settings.py b/dynamicweb/settings.py index 33160ef3..5d95bf75 100644 --- a/dynamicweb/settings.py +++ b/dynamicweb/settings.py @@ -156,6 +156,21 @@ USE_L10N = True USE_TZ = True +try: + from .local.local_settings import * +except ImportError: + logging.warning("No local_settings file found.") + +if not APP_ROOT_ENDPOINT.endswith('/'): + APP_ROOT += '/' +if LOGIN_URL is None: + LOGIN_URL = APP_ROOT + 'accounts/login/' +if LOGOUT_URL is None: + LOGOUT_URL = APP_ROOT_ENDPOINT + 'accounts/logout/' +if LOGIN_REDIRECT_URL is None: + LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT + + # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/1.7/howto/static-files/ @@ -164,8 +179,15 @@ STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static') +# Media files. +MEDIA_ROOT = os.path.abspath(os.path.join(ROOT_PATH, '..', 'media')) +MEDIA_URL = APP_ROOT_ENDPOINT + 'media/' -try: - from .local.local_settings import * -except ImportError: - logging.warning("No local_settings file found.") +# Templates confs +TEMPLATE_DIRS = ( + os.path.join(BASE_DIR, "templates"), +) + +# TODO: Configure it later. +CMS_TEMPLATES = ( +) diff --git a/media/keep b/media/keep new file mode 100644 index 00000000..e69de29b diff --git a/static/keep b/static/keep new file mode 100644 index 00000000..e69de29b