2015-01-05 15:01:42 +01:00
|
|
|
"""
|
2016-09-08 11:13:21 +02:00
|
|
|
Settings file for OpenSlides.
|
2015-01-05 15:01:42 +01:00
|
|
|
|
|
|
|
For more information on this file, see
|
2016-09-08 11:13:21 +02:00
|
|
|
https://docs.djangoproject.com/en/1.10/topics/settings/
|
2015-01-05 15:01:42 +01:00
|
|
|
|
|
|
|
For the full list of settings and their values, see
|
2016-09-08 11:13:21 +02:00
|
|
|
https://docs.djangoproject.com/en/1.10/ref/settings/
|
2015-01-05 15:01:42 +01:00
|
|
|
"""
|
2013-10-28 16:34:53 +01:00
|
|
|
|
2014-01-11 15:47:15 +01:00
|
|
|
import os
|
2013-10-28 16:34:53 +01:00
|
|
|
from openslides.global_settings import *
|
2014-01-11 15:47:15 +01:00
|
|
|
%(import_function)s
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2018-01-16 16:02:23 +01:00
|
|
|
# The directory for user specific data files
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2018-01-16 16:02:23 +01:00
|
|
|
OPENSLIDES_USER_DATA_DIR = %(openslides_user_data_dir)s
|
2013-10-28 16:34:53 +01:00
|
|
|
|
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
# OpenSlides plugins
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
# Add plugins to this list (see example entry in comment).
|
|
|
|
|
2013-12-12 21:22:42 +01:00
|
|
|
INSTALLED_PLUGINS += (
|
2016-05-17 14:15:22 +02:00
|
|
|
# 'plugin_module_name',
|
2013-10-28 16:34:53 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
INSTALLED_APPS += INSTALLED_PLUGINS
|
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Important settings for production use
|
|
|
|
# https://docs.djangoproject.com/en/1.10/howto/deployment/checklist/
|
|
|
|
|
|
|
|
# SECURITY WARNING: Keep the secret key used in production secret!
|
|
|
|
|
|
|
|
SECRET_KEY = %(secret_key)r
|
|
|
|
|
|
|
|
# Use 'DEBUG = True' to get more details for server errors.
|
|
|
|
# SECURITY WARNING: Don't run with debug turned on in production!
|
|
|
|
|
|
|
|
DEBUG = %(debug)s
|
|
|
|
|
2017-11-28 10:47:29 +01:00
|
|
|
# Email settings
|
|
|
|
# For SSL/TLS specific settings see https://docs.djangoproject.com/en/1.11/topics/email/#smtp-backend
|
|
|
|
|
|
|
|
EMAIL_HOST = 'localhost'
|
|
|
|
EMAIL_PORT = 587
|
|
|
|
EMAIL_HOST_USER = ''
|
|
|
|
EMAIL_HOST_PASSWORD = ''
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2019-02-25 09:28:32 +01:00
|
|
|
# Increasing Upload size to 100mb (default is 2.5mb)
|
|
|
|
DATA_UPLOAD_MAX_MEMORY_SIZE = 104857600
|
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
# Database
|
2016-09-08 11:13:21 +02:00
|
|
|
# https://docs.djangoproject.com/en/1.10/ref/settings/#databases
|
|
|
|
|
|
|
|
# Change this setting to use e. g. PostgreSQL or MySQL.
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2016-09-30 21:43:22 +02:00
|
|
|
# DATABASES = {
|
|
|
|
# 'default': {
|
|
|
|
# 'ENGINE': 'django.db.backends.postgresql',
|
|
|
|
# 'NAME': 'mydatabase',
|
|
|
|
# 'USER': 'mydatabaseuser',
|
|
|
|
# 'PASSWORD': 'mypassword',
|
|
|
|
# 'HOST': '127.0.0.1',
|
|
|
|
# 'PORT': '5432',
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
DATABASES = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'django.db.backends.sqlite3',
|
2018-01-16 16:02:23 +01:00
|
|
|
'NAME': os.path.join(OPENSLIDES_USER_DATA_DIR, 'db.sqlite3'),
|
2015-01-05 15:01:42 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-12-17 09:30:20 +01:00
|
|
|
# Set use_redis to True to activate redis as cache-, asgi- and session backend.
|
|
|
|
use_redis = False
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2016-12-17 09:30:20 +01:00
|
|
|
if use_redis:
|
|
|
|
# Django Channels
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
# https://channels.readthedocs.io/en/latest/topics/channel_layers.html#configuration
|
2018-11-21 15:41:27 +01:00
|
|
|
CHANNEL_LAYERS = {
|
|
|
|
"default": {
|
|
|
|
"BACKEND": "channels_redis.core.RedisChannelLayer",
|
|
|
|
"CONFIG": {
|
|
|
|
"hosts": [("localhost", 6379)],
|
|
|
|
"capacity": 100000,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
2018-07-09 23:22:26 +02:00
|
|
|
# Collection Cache
|
2016-12-17 09:30:20 +01:00
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
# Can be:
|
|
|
|
# a Redis URI — "redis://host:6379/0?encoding=utf-8";
|
|
|
|
# a (host, port) tuple — ('localhost', 6379);
|
|
|
|
# or a unix domain socket path string — "/path/to/redis.sock".
|
|
|
|
REDIS_ADDRESS = "redis://127.0.0.1"
|
2016-12-17 09:30:20 +01:00
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
# When use_redis is True, the restricted data cache caches the data individuel
|
|
|
|
# for each user. This requires a lot of memory if there are a lot of active
|
|
|
|
# users.
|
|
|
|
RESTRICTED_DATA_CACHE = True
|
2016-12-17 09:30:20 +01:00
|
|
|
|
|
|
|
# Session backend
|
|
|
|
|
2018-07-09 23:22:26 +02:00
|
|
|
# Redis configuration for django-redis-sessions.
|
2016-12-17 09:30:20 +01:00
|
|
|
# https://github.com/martinrusev/django-redis-sessions
|
|
|
|
|
|
|
|
SESSION_ENGINE = 'redis_sessions.session'
|
2018-07-09 23:22:26 +02:00
|
|
|
SESSION_REDIS = {
|
|
|
|
'host': '127.0.0.1',
|
|
|
|
'post': 6379,
|
|
|
|
'db': 0,
|
2019-01-19 17:42:18 +01:00
|
|
|
"prefix": "session"
|
2018-07-09 23:22:26 +02:00
|
|
|
}
|
2016-09-08 11:13:21 +02:00
|
|
|
|
2016-05-29 08:29:14 +02:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Internationalization
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/i18n/
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2014-01-11 15:47:15 +01:00
|
|
|
TIME_ZONE = 'Europe/Berlin'
|
|
|
|
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
# Static files (CSS, JavaScript, Images)
|
|
|
|
# https://docs.djangoproject.com/en/1.10/howto/static-files/
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2018-01-16 16:02:23 +01:00
|
|
|
STATICFILES_DIRS = [os.path.join(OPENSLIDES_USER_DATA_DIR, 'static')] + STATICFILES_DIRS
|
2013-10-28 16:34:53 +01:00
|
|
|
|
2018-01-16 16:02:23 +01:00
|
|
|
STATIC_ROOT = os.path.join(OPENSLIDES_USER_DATA_DIR, 'collected-static')
|
2017-02-15 13:22:08 +01:00
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
# Files
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/files/
|
|
|
|
|
2018-01-16 16:02:23 +01:00
|
|
|
MEDIA_ROOT = os.path.join(OPENSLIDES_USER_DATA_DIR, 'media', '')
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
|
2017-04-13 16:19:20 +02:00
|
|
|
# Password validation
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/auth/passwords/#module-django.contrib.auth.password_validation
|
|
|
|
# AUTH_PASSWORD_VALIDATORS = []
|
|
|
|
|
2017-09-18 09:40:57 +02:00
|
|
|
|
2016-11-30 11:51:18 +01:00
|
|
|
# Customization of OpenSlides apps
|
|
|
|
|
|
|
|
MOTION_IDENTIFIER_MIN_DIGITS = 1
|
2017-01-06 12:50:29 +01:00
|
|
|
MOTION_IDENTIFIER_WITHOUT_BLANKS = False
|
2017-01-06 13:01:08 +01:00
|
|
|
MOTIONS_ALLOW_AMENDMENTS_OF_AMENDMENTS = True
|