blob: dedc23015fa7f3c1ac233202076e883dbe67b5f2 [file] [log] [blame]
lombardoffb37bca2018-05-03 16:20:04 +02001"""
2Django settings for sf_t3d project.
3
4Generated by 'django-admin startproject' using Django 1.9.
5
6For more information on this file, see
7https://docs.djangoproject.com/en/1.9/topics/settings/
8
9For the full list of settings and their values, see
10https://docs.djangoproject.com/en/1.9/ref/settings/
11"""
12
13import os
14
15# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
17
18
19# Quick-start development settings - unsuitable for production
20# See https://docs.djangoproject.com/en/1.9/howto/deployment/checklist/
21
22# SECURITY WARNING: keep the secret key used in production secret!
23SECRET_KEY = 'o5+o2jv(3-dqr(&ia#-@79cgr%xi*s+6xjws^8cxp211ge#buf'
24
25# SECURITY WARNING: don't run with debug turned on in production!
26DEBUG = True
27
28ALLOWED_HOSTS = []
29
lombardofr84d0a012018-06-12 11:21:02 +020030AUTH_USER_MODEL = "authosm.OsmUser"
lombardoffb37bca2018-05-03 16:20:04 +020031
lombardof33848292018-05-08 10:12:14 +020032SITE_NAME = "Open Source MANO"
33SHORT_SITE_NAME = "OSM"
lombardoffb37bca2018-05-03 16:20:04 +020034
35LOGIN_URL = '/auth/'
36LOGOUT_URL = '/auth/'
37
38VERSION = "0.0.1"
39
40
41# Application definition
42INSTALLED_APPS = [
43 'django.contrib.admin',
44 'django.contrib.auth',
45 'django.contrib.contenttypes',
46 'django.contrib.messages',
47 'django.contrib.staticfiles',
lombardofr672969e2018-06-19 16:59:45 +020048 'django.contrib.sessions',
lombardofr84d0a012018-06-12 11:21:02 +020049 'authosm',
lombardoffb37bca2018-05-03 16:20:04 +020050 'projecthandler',
51 'vimhandler',
lombardofa03da5e2018-06-02 18:36:44 +020052 'instancehandler',
lombardofr84d0a012018-06-12 11:21:02 +020053 'sdnctrlhandler',
54
lombardoffb37bca2018-05-03 16:20:04 +020055]
56
57MIDDLEWARE_CLASSES = [
58 'django.middleware.security.SecurityMiddleware',
59 'django.contrib.sessions.middleware.SessionMiddleware',
60 'django.middleware.common.CommonMiddleware',
61 'django.middleware.csrf.CsrfViewMiddleware',
62 'django.contrib.auth.middleware.AuthenticationMiddleware',
63 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
64 'django.contrib.messages.middleware.MessageMiddleware',
65 'django.middleware.clickjacking.XFrameOptionsMiddleware',
66
67]
68
lombardofr672969e2018-06-19 16:59:45 +020069SESSION_ENGINE ='django.contrib.sessions.backends.db'
lombardoffb37bca2018-05-03 16:20:04 +020070SESSION_COOKIE_AGE = 3500 #25 min
71SESSION_EXPIRE_AT_BROWSER_CLOSE = True
72SESSION_SAVE_EVERY_REQUEST = True
73
74ROOT_URLCONF = 'sf_t3d.urls'
75
76TEMPLATES = [
77 {
78 'BACKEND': 'django.template.backends.django.DjangoTemplates',
79 'DIRS': [
80 os.path.join(BASE_DIR, 'template'),
81 os.path.join(BASE_DIR, 'projecthandler', 'template'),
82 os.path.join(BASE_DIR, 'projecthandler', 'template', 'download'),
83 os.path.join(BASE_DIR, 'projecthandler', 'template', 'project'),
84 os.path.join(BASE_DIR, 'vimhandler', 'template'),
85 os.path.join(BASE_DIR, 'instancehandler', 'template'),
lombardofa03da5e2018-06-02 18:36:44 +020086 os.path.join(BASE_DIR, 'sdnctrlhandler', 'template'),
lombardoffb37bca2018-05-03 16:20:04 +020087 ],
88 'APP_DIRS': True,
89 'OPTIONS': {
90 'context_processors': [
91 'django.template.context_processors.debug',
92 'django.template.context_processors.request',
93 'django.contrib.auth.context_processors.auth',
94 'django.contrib.messages.context_processors.messages',
95 'sf_t3d.context_processor.conf_constants',
96 ],
97 'libraries':{
98 'get': 'sf_t3d.templatetags.get',
lombardof74ed51a2018-05-11 01:07:01 +020099 'date_tag': 'sf_t3d.templatetags.datetag',
lombardoffb37bca2018-05-03 16:20:04 +0200100 }
101 },
102 },
103]
104
105WSGI_APPLICATION = 'sf_t3d.wsgi.application'
106
107
108# Database
109# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
110
111DATABASES = {
112 'default': {
113 'ENGINE': 'django.db.backends.sqlite3',
114 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
115 }
116}
117
lombardofr84d0a012018-06-12 11:21:02 +0200118AUTHENTICATION_BACKENDS = ['authosm.backend.OsmBackend']
119
lombardoffb37bca2018-05-03 16:20:04 +0200120
121# Password validation
122# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
123
124AUTH_PASSWORD_VALIDATORS = [
125 {
126 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
127 },
128 {
129 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
130 },
131 {
132 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
133 },
134 {
135 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
136 },
137]
138
139
140# Internationalization
141# https://docs.djangoproject.com/en/1.9/topics/i18n/
142
143LANGUAGE_CODE = 'en-us'
144
145TIME_ZONE = 'UTC'
146
147USE_I18N = True
148
149USE_L10N = True
150
151USE_TZ = True
152
153
154# Static files (CSS, JavaScript, Images)
155# https://docs.djangoproject.com/en/1.9/howto/static-files/
156
157STATIC_URL = '/static/'
158
159STATICFILES_FINDERS = (
160 'django.contrib.staticfiles.finders.FileSystemFinder',
161 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
162 'django.contrib.staticfiles.finders.DefaultStorageFinder'
163)
164
165STATICFILES_DIRS = (
166 # Put strings here, like "/home/html/static" or "C:/www/django/static".
167 # Always use forward slashes, even on Windows.
168 # Don't forget to use absolute paths, not relative paths.
169 os.path.join(BASE_DIR, "static"),
170)
171
172LOCALE_PATHS = (
173 os.path.join(BASE_DIR, 'locale'),
174)