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
|
|
|
|
2014-01-11 15:47:15 +01:00
|
|
|
# Path to the directory for user specific data files
|
2015-01-05 15:01:42 +01:00
|
|
|
|
2014-01-11 15:47:15 +01:00
|
|
|
OPENSLIDES_USER_DATA_PATH = %(openslides_user_data_path)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',
|
2017-08-09 14:27:39 +02:00
|
|
|
|
|
|
|
# Built-in plugins:
|
|
|
|
# 'tests.example_data_generator',
|
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
|
|
|
|
|
|
|
|
|
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',
|
2016-09-08 11:13:21 +02:00
|
|
|
'NAME': os.path.join(OPENSLIDES_USER_DATA_PATH, '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
|
|
|
|
2016-12-17 09:30:20 +01:00
|
|
|
# Unless you have only a small assembly uncomment the following lines to
|
|
|
|
# activate Redis as backend for Django Channels and Cache. You have to install
|
|
|
|
# a Redis server and the python packages asgi_redis and django-redis.
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2016-12-17 09:30:20 +01:00
|
|
|
# https://channels.readthedocs.io/en/latest/backends.html#redis
|
2016-09-30 21:43:22 +02:00
|
|
|
|
2016-12-17 09:30:20 +01:00
|
|
|
CHANNEL_LAYERS['default']['BACKEND'] = 'asgi_redis.RedisChannelLayer'
|
2017-01-26 17:05:43 +01:00
|
|
|
CHANNEL_LAYERS['default']['CONFIG']['prefix'] = 'asgi:'
|
2016-12-17 09:30:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Caching
|
|
|
|
|
|
|
|
# Django uses a inmemory cache at default. This supports only one thread. If
|
|
|
|
# you use more then one thread another caching backend is required. We recommand
|
|
|
|
# django-redis: https://niwinz.github.io/django-redis/latest/#_user_guide
|
|
|
|
|
|
|
|
CACHES = {
|
|
|
|
"default": {
|
|
|
|
"BACKEND": "django_redis.cache.RedisCache",
|
|
|
|
"LOCATION": "redis://127.0.0.1:6379/0",
|
|
|
|
"OPTIONS": {
|
|
|
|
"CLIENT_CLASS": "django_redis.client.DefaultClient",
|
2017-01-26 17:05:43 +01:00
|
|
|
},
|
2017-01-26 18:03:13 +01:00
|
|
|
"KEY_PREFIX": "openslides-cache",
|
2016-12-17 09:30:20 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
# Session backend
|
|
|
|
|
|
|
|
# Per default django uses the database as session backend. This can be slow.
|
|
|
|
# One possibility is to use the cache session backend with redis as cache backend
|
|
|
|
# Another possibility is to use a native redis session backend. For example:
|
|
|
|
# https://github.com/martinrusev/django-redis-sessions
|
|
|
|
|
|
|
|
# SESSION_ENGINE = 'django.contrib.sessions.backends.cache'
|
|
|
|
SESSION_ENGINE = 'redis_sessions.session'
|
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
|
|
|
|
|
|
|
STATICFILES_DIRS = [os.path.join(OPENSLIDES_USER_DATA_PATH, 'static')] + STATICFILES_DIRS
|
2013-10-28 16:34:53 +01:00
|
|
|
|
2017-02-15 13:22:08 +01:00
|
|
|
STATIC_ROOT = os.path.join(OPENSLIDES_USER_DATA_PATH, 'collected-static')
|
|
|
|
|
2016-09-08 11:13:21 +02:00
|
|
|
|
|
|
|
# Files
|
|
|
|
# https://docs.djangoproject.com/en/1.10/topics/files/
|
|
|
|
|
|
|
|
MEDIA_ROOT = os.path.join(OPENSLIDES_USER_DATA_PATH, 'media', '')
|
|
|
|
|
|
|
|
|
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 = []
|
|
|
|
|
|
|
|
|
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
|