X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=sf_t3d%2Fsettings.py;h=753537a34842026ec2e37703b4cf38986f0c23e5;hb=6e240e970b0f01790b20cff77f2a49d1f66834b6;hp=dedc23015fa7f3c1ac233202076e883dbe67b5f2;hpb=0793022e37fb0d73e46bcdc0b74a673709508603;p=osm%2FLW-UI.git diff --git a/sf_t3d/settings.py b/sf_t3d/settings.py index dedc230..753537a 100644 --- a/sf_t3d/settings.py +++ b/sf_t3d/settings.py @@ -21,11 +21,12 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'o5+o2jv(3-dqr(&ia#-@79cgr%xi*s+6xjws^8cxp211ge#buf' - -# SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True - -ALLOWED_HOSTS = [] +if os.getenv('DJANGO_ENV') == 'prod': + DEBUG = False +else: + DEBUG = True + print DEBUG +ALLOWED_HOSTS = ['*'] AUTH_USER_MODEL = "authosm.OsmUser" @@ -51,12 +52,14 @@ INSTALLED_APPS = [ 'vimhandler', 'instancehandler', 'sdnctrlhandler', + 'userhandler' ] MIDDLEWARE_CLASSES = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', + 'projecthandler.middleware.OsmProjectMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', @@ -64,6 +67,7 @@ MIDDLEWARE_CLASSES = [ 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + ] SESSION_ENGINE ='django.contrib.sessions.backends.db' @@ -84,6 +88,7 @@ TEMPLATES = [ os.path.join(BASE_DIR, 'vimhandler', 'template'), os.path.join(BASE_DIR, 'instancehandler', 'template'), os.path.join(BASE_DIR, 'sdnctrlhandler', 'template'), + os.path.join(BASE_DIR, 'userhandler', 'templates'), ], 'APP_DIRS': True, 'OPTIONS': { @@ -155,20 +160,21 @@ USE_TZ = True # https://docs.djangoproject.com/en/1.9/howto/static-files/ STATIC_URL = '/static/' - -STATICFILES_FINDERS = ( - 'django.contrib.staticfiles.finders.FileSystemFinder', - 'django.contrib.staticfiles.finders.AppDirectoriesFinder', - 'django.contrib.staticfiles.finders.DefaultStorageFinder' -) - -STATICFILES_DIRS = ( - # Put strings here, like "/home/html/static" or "C:/www/django/static". - # Always use forward slashes, even on Windows. - # Don't forget to use absolute paths, not relative paths. - os.path.join(BASE_DIR, "static"), -) +if DEBUG: + STATICFILES_FINDERS = ( + 'django.contrib.staticfiles.finders.FileSystemFinder', + 'django.contrib.staticfiles.finders.AppDirectoriesFinder', + 'django.contrib.staticfiles.finders.DefaultStorageFinder' + ) + STATICFILES_DIRS = ( + # Put strings here, like "/home/html/static" or "C:/www/django/static". + # Always use forward slashes, even on Windows. + # Don't forget to use absolute paths, not relative paths. + os.path.join(BASE_DIR, "static"), + ) +else: + STATIC_ROOT = os.path.join(BASE_DIR, "static/") LOCALE_PATHS = ( os.path.join(BASE_DIR, 'locale'), -) \ No newline at end of file +)