From d7976375ec9f612f2c594c702d96f554a7db59cb Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:20:00 +1000 Subject: [PATCH] Tidied BASE_DIR/SITE_ROOT --- mayan/settings/includes/common.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 3bee2e108b..7ae1e39808 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -10,12 +10,17 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os +import sys ugettext = lambda s: s _file_path = os.path.abspath(os.path.dirname(__file__)).split('/') -BASE_DIR = '/'.join(_file_path[0:-2]) -SITE_ROOT = '/'.join(_file_path[0:-3]) +BASE_DIR = SITE_ROOT = '/'.join(_file_path[0:-3]) + +sys.path.append(os.path.join(BASE_DIR, 'mayan', 'apps')) + +STATIC_URL = '/static/' +STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected') # Quick-start development settings - unsuitable for production @@ -124,7 +129,7 @@ WSGI_APPLICATION = 'mayan.wsgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(SITE_ROOT, 'db.sqlite3'), + 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), } } @@ -142,18 +147,12 @@ USE_L10N = True USE_TZ = True -# Static files (CSS, JavaScript, Images) -# https://docs.djangoproject.com/en/1.6/howto/static-files/ - -STATIC_URL = '/static/' # Custom settings section -import sys from django.core.urlresolvers import reverse_lazy -sys.path.append(os.path.join(BASE_DIR, 'apps')) PROJECT_TITLE = 'Mayan EDMS' PROJECT_NAME = 'mayan' @@ -185,9 +184,6 @@ LANGUAGES = ( SITE_ID = 1 -STATIC_ROOT = os.path.join(SITE_ROOT, 'static/') - -STATIC_URL = '/%s-static/' % PROJECT_NAME ADMIN_MEDIA_PREFIX = STATIC_URL + 'admin/'