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
|
|
|
|
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',
|
|
|
|
]
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'openslides.urls'
|
|
|
|
|
|
|
|
ALLOWED_HOSTS = ['*']
|
|
|
|
|
|
|
|
TEMPLATES = [
|
|
|
|
{
|
|
|
|
'BACKEND': 'django.template.backends.django.DjangoTemplates',
|
|
|
|
'DIRS': [],
|
|
|
|
'APP_DIRS': True,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
# 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 = [
|
2016-09-08 11:13:21 +02:00
|
|
|
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
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
AUTH_USER_MODEL = 'users.User'
|
2012-10-25 15:17:25 +02:00
|
|
|
|
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',
|
2016-09-08 11:13:21 +02:00
|
|
|
'django.contrib.auth.hashers.MD5PasswordHasher', # MD5 is only used for initial passwords.
|
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/
|
|
|
|
|
|
|
|
MEDIA_URL = '/media/'
|
|
|
|
|
|
|
|
|
|
|
|
# Cache
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/cache/
|
|
|
|
|
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
2017-01-14 12:27:27 +01:00
|
|
|
'LOCATION': 'openslides-cache',
|
|
|
|
'OPTIONS': {
|
|
|
|
'MAX_ENTRIES': 10000
|
|
|
|
}
|
2016-09-08 11:13:21 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
# Django Channels
|
|
|
|
# http://channels.readthedocs.io/en/latest/
|
2017-02-15 13:22:08 +01:00
|
|
|
# https://github.com/ostcar/geiss
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2016-05-29 08:29:14 +02:00
|
|
|
CHANNEL_LAYERS = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'asgiref.inmemory.ChannelLayer',
|
|
|
|
'ROUTING': 'openslides.routing.channel_routing',
|
2016-09-17 22:26:23 +02:00
|
|
|
'CONFIG': {
|
|
|
|
'capacity': 1000,
|
|
|
|
},
|
2016-05-29 08:29:14 +02:00
|
|
|
},
|
|
|
|
}
|