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 = [
|
2019-01-06 16:22:33 +01:00
|
|
|
"openslides.core",
|
|
|
|
"openslides.users",
|
|
|
|
"django.contrib.auth",
|
|
|
|
"django.contrib.contenttypes",
|
|
|
|
"django.contrib.sessions",
|
|
|
|
"django.contrib.staticfiles",
|
|
|
|
"rest_framework",
|
|
|
|
"channels",
|
|
|
|
"openslides.agenda",
|
|
|
|
"openslides.topics",
|
|
|
|
"openslides.motions",
|
|
|
|
"openslides.assignments",
|
|
|
|
"openslides.mediafiles",
|
2016-09-08 11:13:21 +02:00
|
|
|
]
|
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 = [
|
2019-01-06 16:22:33 +01:00
|
|
|
"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",
|
|
|
|
"openslides.utils.autoupdate.AutoupdateBundleMiddleware",
|
2016-09-08 11:13:21 +02:00
|
|
|
]
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
ROOT_URLCONF = "openslides.urls"
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
ALLOWED_HOSTS = ["*"]
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
2019-01-06 16:22:33 +01:00
|
|
|
"BACKEND": "django.template.backends.django.DjangoTemplates",
|
|
|
|
"DIRS": [],
|
|
|
|
"APP_DIRS": True,
|
|
|
|
}
|
2016-09-08 11:13:21 +02:00
|
|
|
]
|
|
|
|
|
2017-11-28 10:47:29 +01:00
|
|
|
# Email
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/email/
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
|
|
|
|
EMAIL_TIMEOUT = (
|
2019-10-29 15:05:52 +01:00
|
|
|
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/
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
LANGUAGE_CODE = "en"
|
2012-07-27 23:18:31 +02:00
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
LANGUAGES = (
|
2019-01-06 16:22:33 +01:00
|
|
|
("en", "English"),
|
|
|
|
("de", "Deutsch"),
|
|
|
|
("fr", "Français"),
|
|
|
|
("es", "Español"),
|
|
|
|
("pt", "Português"),
|
|
|
|
("cs", "Český"),
|
|
|
|
("ru", "русский"),
|
2012-02-09 17:35:18 +01:00
|
|
|
)
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
TIME_ZONE = "UTC"
|
2016-09-08 11:13:21 +02:00
|
|
|
|
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
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
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
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
STATIC_URL = "/static/"
|
2012-04-14 14:51:56 +02:00
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
STATICFILES_DIRS = [os.path.join(MODULE_DIR, "static")]
|
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
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
AUTH_USER_MODEL = "users.User"
|
2012-10-25 15:17:25 +02:00
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
AUTH_GROUP_MODEL = "users.Group"
|
2018-08-31 15:33:41 +02:00
|
|
|
|
2019-01-06 16:22:33 +01: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
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
CSRF_COOKIE_NAME = "OpenSlidesCsrfToken"
|
2016-12-05 15:24:43 +01:00
|
|
|
|
|
|
|
CSRF_COOKIE_AGE = None
|
|
|
|
|
2016-09-08 00:02:18 +02:00
|
|
|
PASSWORD_HASHERS = [
|
2019-01-06 16:22:33 +01:00
|
|
|
"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",
|
2016-09-08 00:02:18 +02:00
|
|
|
]
|
|
|
|
|
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/
|
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
MEDIA_URL = "/media/"
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
|
|
|
|
# Django Channels
|
|
|
|
# http://channels.readthedocs.io/en/latest/
|
2018-07-09 23:22:26 +02:00
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
ASGI_APPLICATION = "openslides.routing.application"
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2019-01-06 16:22:33 +01:00
|
|
|
CHANNEL_LAYERS = {"default": {"BACKEND": "channels.layers.InMemoryChannelLayer"}}
|
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
|