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