dedc23015fa7f3c1ac233202076e883dbe67b5f2
[osm/LW-UI.git] / sf_t3d / settings.py
1 """
2 Django settings for sf_t3d project.
3
4 Generated by 'django-admin startproject' using Django 1.9.
5
6 For more information on this file, see
7 https://docs.djangoproject.com/en/1.9/topics/settings/
8
9 For the full list of settings and their values, see
10 https://docs.djangoproject.com/en/1.9/ref/settings/
11 """
12
13 import os
14
15 # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
16 BASE_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!
23 SECRET_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!
26 DEBUG = True
27
28 ALLOWED_HOSTS = []
29
30 AUTH_USER_MODEL = "authosm.OsmUser"
31
32 SITE_NAME = "Open Source MANO"
33 SHORT_SITE_NAME = "OSM"
34
35 LOGIN_URL = '/auth/'
36 LOGOUT_URL = '/auth/'
37
38 VERSION = "0.0.1"
39
40
41 # Application definition
42 INSTALLED_APPS = [
43 'django.contrib.admin',
44 'django.contrib.auth',
45 'django.contrib.contenttypes',
46 'django.contrib.messages',
47 'django.contrib.staticfiles',
48 'django.contrib.sessions',
49 'authosm',
50 'projecthandler',
51 'vimhandler',
52 'instancehandler',
53 'sdnctrlhandler',
54
55 ]
56
57 MIDDLEWARE_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
69 SESSION_ENGINE ='django.contrib.sessions.backends.db'
70 SESSION_COOKIE_AGE = 3500 #25 min
71 SESSION_EXPIRE_AT_BROWSER_CLOSE = True
72 SESSION_SAVE_EVERY_REQUEST = True
73
74 ROOT_URLCONF = 'sf_t3d.urls'
75
76 TEMPLATES = [
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'),
86 os.path.join(BASE_DIR, 'sdnctrlhandler', 'template'),
87 ],
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',
99 'date_tag': 'sf_t3d.templatetags.datetag',
100 }
101 },
102 },
103 ]
104
105 WSGI_APPLICATION = 'sf_t3d.wsgi.application'
106
107
108 # Database
109 # https://docs.djangoproject.com/en/1.9/ref/settings/#databases
110
111 DATABASES = {
112 'default': {
113 'ENGINE': 'django.db.backends.sqlite3',
114 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
115 }
116 }
117
118 AUTHENTICATION_BACKENDS = ['authosm.backend.OsmBackend']
119
120
121 # Password validation
122 # https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
123
124 AUTH_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
143 LANGUAGE_CODE = 'en-us'
144
145 TIME_ZONE = 'UTC'
146
147 USE_I18N = True
148
149 USE_L10N = True
150
151 USE_TZ = True
152
153
154 # Static files (CSS, JavaScript, Images)
155 # https://docs.djangoproject.com/en/1.9/howto/static-files/
156
157 STATIC_URL = '/static/'
158
159 STATICFILES_FINDERS = (
160 'django.contrib.staticfiles.finders.FileSystemFinder',
161 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
162 'django.contrib.staticfiles.finders.DefaultStorageFinder'
163 )
164
165 STATICFILES_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
172 LOCALE_PATHS = (
173 os.path.join(BASE_DIR, 'locale'),
174 )