2 # Copyright 2018 EveryUP Srl
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
19 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
20 BASE_DIR
= os
.path
.dirname(os
.path
.dirname(os
.path
.abspath(__file__
)))
23 # Quick-start development settings - unsuitable for production
24 # See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
26 # SECURITY WARNING: keep the secret key used in production secret!
27 SECRET_KEY
= 'o5+o2jv(3-dqr(&ia#-@79cgr%xi*s+6xjws^8cxp211ge#buf'
28 if os
.getenv('DJANGO_ENV') == 'prod':
35 AUTH_USER_MODEL
= "authosm.OsmUser"
37 SITE_NAME
= "Open Source MANO"
38 SHORT_SITE_NAME
= "OSM"
46 # Application definition
48 'django.contrib.admin',
49 'django.contrib.auth',
50 'django.contrib.contenttypes',
51 'django.contrib.messages',
52 'django.contrib.staticfiles',
53 'django.contrib.sessions',
64 MIDDLEWARE_CLASSES
= [
65 'django.middleware.security.SecurityMiddleware',
66 'django.contrib.sessions.middleware.SessionMiddleware',
67 'projecthandler.middleware.OsmProjectMiddleware',
68 'django.middleware.common.CommonMiddleware',
69 'django.middleware.csrf.CsrfViewMiddleware',
70 'django.contrib.auth.middleware.AuthenticationMiddleware',
71 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
72 'django.contrib.messages.middleware.MessageMiddleware',
73 'django.middleware.clickjacking.XFrameOptionsMiddleware',
78 SESSION_ENGINE
='django.contrib.sessions.backends.db'
79 SESSION_COOKIE_AGE
= 3500 #25 min
80 SESSION_EXPIRE_AT_BROWSER_CLOSE
= True
81 SESSION_SAVE_EVERY_REQUEST
= True
83 ROOT_URLCONF
= 'sf_t3d.urls'
87 'BACKEND': 'django.template.backends.django.DjangoTemplates',
89 os
.path
.join(BASE_DIR
, 'template'),
90 os
.path
.join(BASE_DIR
, 'projecthandler', 'template'),
91 os
.path
.join(BASE_DIR
, 'projecthandler', 'template', 'download'),
92 os
.path
.join(BASE_DIR
, 'projecthandler', 'template', 'project'),
93 os
.path
.join(BASE_DIR
, 'descriptorhandler', 'template'),
94 os
.path
.join(BASE_DIR
, 'vimhandler', 'template'),
95 os
.path
.join(BASE_DIR
, 'instancehandler', 'template'),
96 os
.path
.join(BASE_DIR
, 'sdnctrlhandler', 'template'),
97 os
.path
.join(BASE_DIR
, 'userhandler', 'templates'),
101 'context_processors': [
102 'django.template.context_processors.debug',
103 'django.template.context_processors.request',
104 'django.contrib.auth.context_processors.auth',
105 'django.contrib.messages.context_processors.messages',
106 'sf_t3d.context_processor.conf_constants',
109 'get': 'sf_t3d.templatetags.get',
110 'date_tag': 'sf_t3d.templatetags.datetag',
116 WSGI_APPLICATION
= 'sf_t3d.wsgi.application'
120 # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
124 'ENGINE': 'django.db.backends.sqlite3',
125 'NAME': os
.path
.join(BASE_DIR
, 'db.sqlite3'),
129 AUTHENTICATION_BACKENDS
= ['authosm.backend.OsmBackend']
132 # Password validation
133 # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
135 AUTH_PASSWORD_VALIDATORS
= [
137 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
140 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
143 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
146 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
151 # Internationalization
152 # https://docs.djangoproject.com/en/1.9/topics/i18n/
154 LANGUAGE_CODE
= 'en-us'
165 # Static files (CSS, JavaScript, Images)
166 # https://docs.djangoproject.com/en/1.9/howto/static-files/
168 STATIC_URL
= '/static/'
170 STATICFILES_FINDERS
= (
171 'django.contrib.staticfiles.finders.FileSystemFinder',
172 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
173 'django.contrib.staticfiles.finders.DefaultStorageFinder'
176 # Put strings here, like "/home/html/static" or "C:/www/django/static".
177 # Always use forward slashes, even on Windows.
178 # Don't forget to use absolute paths, not relative paths.
179 os
.path
.join(BASE_DIR
, "static"),
182 STATIC_ROOT
= os
.path
.join(BASE_DIR
, "static/")
185 os
.path
.join(BASE_DIR
, 'locale'),