2015-06-16 10:37:23 +02:00
|
|
|
import os
|
2013-11-24 09:58:48 +01:00
|
|
|
|
2014-04-28 23:37:22 +02:00
|
|
|
from openslides.utils.plugins import collect_plugins
|
2012-05-30 23:30:24 +02:00
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
MODULE_DIR = os.path.realpath(os.path.dirname(os.path.abspath(__file__)))
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2014-10-11 14:34:49 +02:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Application definition
|
2015-02-12 20:57:05 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
INSTALLED_APPS = [
|
|
|
|
'openslides.core',
|
|
|
|
'openslides.users',
|
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.staticfiles',
|
|
|
|
'rest_framework',
|
|
|
|
'channels',
|
|
|
|
'openslides.agenda',
|
2016-09-18 22:14:24 +02:00
|
|
|
'openslides.topics',
|
2016-09-08 11:13:21 +02:00
|
|
|
'openslides.motions',
|
|
|
|
'openslides.assignments',
|
|
|
|
'openslides.mediafiles',
|
|
|
|
]
|
2016-05-29 08:29:14 +02:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
INSTALLED_PLUGINS = collect_plugins() # Adds all automaticly collected plugins
|
|
|
|
|
|
|
|
MIDDLEWARE = [
|
|
|
|
'django.middleware.security.SecurityMiddleware',
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
|
|
|
'django.contrib.auth.middleware.AuthenticationMiddleware',
|
|
|
|
'django.middleware.clickjacking.XFrameOptionsMiddleware',
|
2018-01-20 13:57:25 +01:00
|
|
|
'openslides.utils.autoupdate.AutoupdateBundleMiddleware',
|
2016-09-08 11:13:21 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'openslides.urls'
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
2017-11-28 10:47:29 +01:00
|
|
|
# Email
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/email/
|
|
|
|
|
|
|
|
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
|
|
|
|
EMAIL_TIMEOUT = 5 # Timeout in seconds for blocking operations like the connection attempt
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
|
|
|
|
|
|
|
LANGUAGE_CODE = 'en'
|
2012-07-27 23:18:31 +02:00
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
LANGUAGES = (
|
2016-05-25 09:39:32 +02:00
|
|
|
('en', 'English'),
|
|
|
|
('de', 'Deutsch'),
|
|
|
|
('fr', 'Français'),
|
|
|
|
('es', 'Español'),
|
|
|
|
('pt', 'Português'),
|
|
|
|
('cs', 'Český'),
|
2017-03-05 22:22:23 +01:00
|
|
|
('ru', 'русский'),
|
2012-02-09 17:35:18 +01:00
|
|
|
)
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
TIME_ZONE = 'UTC'
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
USE_L10N = True
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
USE_TZ = True
|
|
|
|
|
|
|
|
LOCALE_PATHS = [
|
|
|
|
os.path.join(MODULE_DIR, 'locale'),
|
|
|
|
]
|
2012-08-05 22:35:09 +02:00
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2012-11-24 14:01:21 +01:00
|
|
|
STATIC_URL = '/static/'
|
2012-04-14 14:51:56 +02:00
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
STATICFILES_DIRS = [
|
2017-10-10 07:53:43 +02:00
|
|
|
os.path.join(MODULE_DIR, 'static'),
|
2016-09-08 11:13:21 +02:00
|
|
|
]
|
2012-02-09 17:35:18 +01:00
|
|
|
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Sessions and user authentication
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/http/sessions/
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/auth/
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
AUTH_USER_MODEL = 'users.User'
|
2012-10-25 15:17:25 +02:00
|
|
|
|
2018-08-31 15:33:41 +02:00
|
|
|
AUTH_GROUP_MODEL = 'users.Group'
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
SESSION_COOKIE_NAME = 'OpenSlidesSessionID'
|
2014-05-11 19:10:08 +02:00
|
|
|
|
2016-12-05 15:24:43 +01:00
|
|
|
SESSION_EXPIRE_AT_BROWSER_CLOSE = True
|
|
|
|
|
|
|
|
CSRF_COOKIE_NAME = 'OpenSlidesCsrfToken'
|
|
|
|
|
|
|
|
CSRF_COOKIE_AGE = None
|
|
|
|
|
2016-09-08 00:02:18 +02:00
|
|
|
PASSWORD_HASHERS = [
|
|
|
|
'django.contrib.auth.hashers.PBKDF2PasswordHasher',
|
|
|
|
'django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher',
|
|
|
|
'django.contrib.auth.hashers.Argon2PasswordHasher',
|
|
|
|
'django.contrib.auth.hashers.BCryptSHA256PasswordHasher',
|
|
|
|
'django.contrib.auth.hashers.BCryptPasswordHasher',
|
|
|
|
]
|
|
|
|
|
2015-01-25 01:11:14 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Files
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/files/
|
|
|
|
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
|
|
|
|
|
|
|
# Django Channels
|
|
|
|
# http://channels.readthedocs.io/en/latest/
|
2018-07-09 23:22:26 +02:00
|
|
|
|
|
|
|
ASGI_APPLICATION = 'openslides.routing.application'
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2016-05-29 08:29:14 +02:00
|
|
|
CHANNEL_LAYERS = {
|
|
|
|
'default': {
|
2018-07-09 23:22:26 +02:00
|
|
|
'BACKEND': 'channels.layers.InMemoryChannelLayer',
|
2016-05-29 08:29:14 +02:00
|
|
|
},
|
|
|
|
}
|
2017-09-12 12:52:37 +02:00
|
|
|
|
2017-09-18 09:40:57 +02:00
|
|
|
|
2017-09-12 12:52:37 +02:00
|
|
|
# Enable updating the last_login field for users on every login.
|
|
|
|
ENABLE_LAST_LOGIN_FIELD = False
|