blob: 658bafd7687657005bf773aabb32fd505eb019c9 [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
30AUTH_USER_MODEL = "sf_user.CustomUser"
31
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',
48 'sf_user',
49 'projecthandler',
50 'vimhandler',
lombardofa03da5e2018-06-02 18:36:44 +020051 'instancehandler',
52 'sdnctrlhandler'
lombardoffb37bca2018-05-03 16:20:04 +020053]
54
55MIDDLEWARE_CLASSES = [
56 'django.middleware.security.SecurityMiddleware',
57 'django.contrib.sessions.middleware.SessionMiddleware',
58 'django.middleware.common.CommonMiddleware',
59 'django.middleware.csrf.CsrfViewMiddleware',
60 'django.contrib.auth.middleware.AuthenticationMiddleware',
61 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
62 'django.contrib.messages.middleware.MessageMiddleware',
63 'django.middleware.clickjacking.XFrameOptionsMiddleware',
64
65]
66
67SESSION_ENGINE='sf_user.sessions'
68SESSION_COOKIE_AGE = 3500 #25 min
69SESSION_EXPIRE_AT_BROWSER_CLOSE = True
70SESSION_SAVE_EVERY_REQUEST = True
71
72ROOT_URLCONF = 'sf_t3d.urls'
73
74TEMPLATES = [
75 {
76 'BACKEND': 'django.template.backends.django.DjangoTemplates',
77 'DIRS': [
78 os.path.join(BASE_DIR, 'template'),
79 os.path.join(BASE_DIR, 'projecthandler', 'template'),
80 os.path.join(BASE_DIR, 'projecthandler', 'template', 'download'),
81 os.path.join(BASE_DIR, 'projecthandler', 'template', 'project'),
82 os.path.join(BASE_DIR, 'vimhandler', 'template'),
83 os.path.join(BASE_DIR, 'instancehandler', 'template'),
lombardofa03da5e2018-06-02 18:36:44 +020084 os.path.join(BASE_DIR, 'sdnctrlhandler', 'template'),
lombardoffb37bca2018-05-03 16:20:04 +020085 ],
86 'APP_DIRS': True,
87 'OPTIONS': {
88 'context_processors': [
89 'django.template.context_processors.debug',
90 'django.template.context_processors.request',
91 'django.contrib.auth.context_processors.auth',
92 'django.contrib.messages.context_processors.messages',
93 'sf_t3d.context_processor.conf_constants',
94 ],
95 'libraries':{
96 'get': 'sf_t3d.templatetags.get',
lombardof74ed51a2018-05-11 01:07:01 +020097 'date_tag': 'sf_t3d.templatetags.datetag',
lombardoffb37bca2018-05-03 16:20:04 +020098 }
99 },
100 },
101]
102
103WSGI_APPLICATION = 'sf_t3d.wsgi.application'
104
105
106# Database
107# https://docs.djangoproject.com/en/1.9/ref/settings/#databases
108
109DATABASES = {
110 'default': {
111 'ENGINE': 'django.db.backends.sqlite3',
112 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
113 }
114}
115
116
117# Password validation
118# https://docs.djangoproject.com/en/1.9/ref/settings/#auth-password-validators
119
120AUTH_PASSWORD_VALIDATORS = [
121 {
122 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
123 },
124 {
125 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
126 },
127 {
128 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
129 },
130 {
131 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
132 },
133]
134
135
136# Internationalization
137# https://docs.djangoproject.com/en/1.9/topics/i18n/
138
139LANGUAGE_CODE = 'en-us'
140
141TIME_ZONE = 'UTC'
142
143USE_I18N = True
144
145USE_L10N = True
146
147USE_TZ = True
148
149
150# Static files (CSS, JavaScript, Images)
151# https://docs.djangoproject.com/en/1.9/howto/static-files/
152
153STATIC_URL = '/static/'
154
155STATICFILES_FINDERS = (
156 'django.contrib.staticfiles.finders.FileSystemFinder',
157 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
158 'django.contrib.staticfiles.finders.DefaultStorageFinder'
159)
160
161STATICFILES_DIRS = (
162 # Put strings here, like "/home/html/static" or "C:/www/django/static".
163 # Always use forward slashes, even on Windows.
164 # Don't forget to use absolute paths, not relative paths.
165 os.path.join(BASE_DIR, "static"),
166)
167
168LOCALE_PATHS = (
169 os.path.join(BASE_DIR, 'locale'),
170)