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