-
Notifications
You must be signed in to change notification settings - Fork 48
Expand file tree
/
Copy pathsettings.py
More file actions
187 lines (152 loc) · 5.67 KB
/
settings.py
File metadata and controls
187 lines (152 loc) · 5.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# -*- coding: utf-8 -*-
# Django settings used as base for developing wirecloud.
from os import path, environ
from wirecloud.commons.utils.conf import load_default_wirecloud_conf
from django.urls import reverse_lazy
DEBUG = True
BASEDIR = path.dirname(path.abspath(__file__))
load_default_wirecloud_conf(locals())
USE_XSENDFILE = False
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
MANAGERS = ADMINS
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3', # Add 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
'NAME': path.join(BASEDIR, 'wirecloud.db'), # Or path to database file if using sqlite3.
'USER': '', # Not used with sqlite3.
'PASSWORD': '', # Not used with sqlite3.
'HOST': '', # Set to empty string for localhost. Not used with sqlite3.
'PORT': '', # Set to empty string for default. Not used with sqlite3.
},
}
# Hosts/domain names that are valid for this site; required if DEBUG is False
# See https://docs.djangoproject.com/en/2.2/ref/settings/#allowed-hosts
ALLOWED_HOSTS = ['*']
THEME_ACTIVE = "wirecloud.defaulttheme"
# Local time zone for this installation. Choices can be found here:
# http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
# although not all variations may be possible on all operating systems.
# If running in a Windows environment this must be set to the same as your
# system time zone.
TIME_ZONE = 'Europe/Madrid'
DATE_FORMAT = 'd/m/Y'
# Language code for this installation. All choices can be found here:
# http://www.w3.org/TR/REC-html40/struct/dirlang.html#langcodes
LANGUAGE_CODE = 'en'
DEFAULT_LANGUAGE = 'browser'
LANGUAGES = (
('es', 'Spanish'),
('en', 'English'),
('pt', 'Portuguese'),
)
# If you set this to False, Django will make some optimizations so as not
# to load the internationalization machinery.
USE_I18N = True
STATIC_URL = '/static/'
STATIC_ROOT = path.join(BASEDIR, 'static')
COMPRESS_ROOT = STATIC_ROOT
COMPRESS_OUTPUT_DIR = 'cache'
COMPRESS_JS_FILTERS = (
'compressor.filters.jsmin.JSMinFilter',
)
# Make this unique, and don't share it with anybody.
SECRET_KEY = '15=7f)g=)&spodi3bg8%&4fqt%f3rpg%b$-aer5*#a*(rqm79e'
ROOT_URLCONF = 'urls'
INSTALLED_APPS += ( # noqa
'wirecloud.oauth2provider',
'wirecloud.fiware',
'django_nose',
'haystack',
)
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'wirecloud.commons.haystack_backends.whoosh_backend.WhooshEngine',
'PATH': path.join(path.dirname(__file__), 'whoosh_index'),
},
}
# HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'wirecloud.commons.haystack_backends.solr_backend.SolrEngine',
# 'URL': 'http://127.0.0.1:8983/solr'
# # ...or for multicore...
# # 'URL': 'http://127.0.0.1:8983/solr/mysite',
# },
# }
# TEST_HAYSTACK_CONNECTIONS = {
# 'default': {
# 'ENGINE': 'wirecloud.commons.haystack_backends.elasticsearch2_backend.Elasticsearch2SearchEngine',
# 'URL': <'INDEX_URI'>,
# 'INDEX_NAME': 'wirecloud',
# },
# }
TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'
SESSION_COOKIE_AGE = 5184000 # 2 months
SESSION_EXPIRE_AT_BROWSER_CLOSE = False
# Login/logout URLs
LOGIN_URL = reverse_lazy('login')
LOGOUT_URL = reverse_lazy('wirecloud.root')
LOGIN_REDIRECT_URL = reverse_lazy('wirecloud.root')
# Authentication
AUTHENTICATION_BACKENDS = (
'django.contrib.auth.backends.ModelBackend'
)
# WGT deployment dirs
CATALOGUE_MEDIA_ROOT = path.join(BASEDIR, 'catalogue', 'media')
GADGETS_DEPLOYMENT_DIR = path.join(BASEDIR, 'deployment', 'widgets')
# SESSION_COOKIE_DOMAIN = '.domain'
# Cache settings
CACHES = {
'default': {
'BACKEND': 'wirecloud.platform.cache.backends.locmem.LocMemCache',
'OPTIONS': {
'MAX_ENTRIES': 3000,
},
}
}
FORCE_SCRIPT_NAME = ""
# WIRECLOUD_SELENIUM_TEST_BROWSERS = {
#
# # Old versions of Firefox can be found here:
# # http://archive.mozilla.org/pub/mozilla.org/firefox/releases/
#
# 'Firefox': {
# 'CLASS': 'selenium.webdriver.Firefox',
# },
#
# # Download chrome driver from the following URL:
# # https://sites.google.com/a/chromium.org/chromedriver/
# # Old versions of chrome can be found here:
# # http://google-chrome.en.uptodown.com/mac/old
# 'GoogleChrome': {
# 'CLASS': 'selenium.webdriver.Chrome',
# },
#
# # Download opera driver from the following URL:
# # https://github.com/operasoftware/operachromiumdriver/releases
# # Old versions of Opera can be found here:
# # http://get.geo.opera.com.global.prod.fastly.net/pub/opera/
#
# 'Opera': {
# 'CLASS': 'selenium.webdriver.Opera',
# },
#
# # https://blog.codecentric.de/en/2015/02/selenium-webdriver-safari-8/
# 'Safari': {
# 'CLASS': 'selenium.webdriver.Safari',
# },
# }
VC_LOGIN_CONFIG = {
'enabled': environ.get('VC_LOGIN_ENABLED', 'False').lower() in ('true', 'yes', 't'),
'verifier_host': environ.get('VC_VERIFIER_HOST'),
'verifier_qr_path': environ.get('VC_VERIFIER_QR_PATH', '/api/v2/loginQR'),
'verifier_token_path': environ.get('VC_VERIFIER_TOKEN_PATH', '/token'),
'verifier_jwks_path': environ.get('VC_VERIFIER_JWKS_PATH', '/.well-known/jwks'),
'client_id': environ.get('VC_CLIENT_ID'),
'scope': environ.get('VC_SCOPE', 'openid learcredential'),
'role_target': environ.get('VC_ROLE_TARGET'),
'credential_type': environ.get('VC_CREDENTIAL_TYPE', 'LegalPersonCredential'),
}
if VC_LOGIN_CONFIG['enabled']:
AUTHENTICATION_BACKENDS += ('wirecloud.backends.vc_backend.VCBackend')