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
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
|
|
|
|
|
2014-10-11 14:34:49 +02:00
|
|
|
AUTH_USER_MODEL = 'users.User'
|
|
|
|
|
2015-02-12 20:57:05 +01:00
|
|
|
AUTHENTICATION_BACKENDS = ('openslides.users.auth.CustomizedModelBackend',)
|
|
|
|
|
2012-07-27 23:18:31 +02:00
|
|
|
SESSION_COOKIE_NAME = 'OpenSlidesSessionID'
|
|
|
|
|
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ý'),
|
2012-02-09 17:35:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
# If you set this to False, Django will make some optimizations so as not
|
|
|
|
# to load the internationalization machinery.
|
|
|
|
USE_I18N = True
|
|
|
|
|
|
|
|
# If you set this to False, Django will not format dates, numbers and
|
|
|
|
# calendars according to the current locale
|
|
|
|
USE_L10N = True
|
|
|
|
|
2012-08-05 22:35:09 +02:00
|
|
|
LOCALE_PATHS = (
|
2014-08-16 09:25:18 +02:00
|
|
|
os.path.join(SITE_ROOT, 'locale'),
|
2012-08-05 22:35:09 +02:00
|
|
|
)
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
# URL that handles the media served from MEDIA_ROOT. Make sure to use a
|
|
|
|
# trailing slash if there is a path component (optional in other cases).
|
|
|
|
# Examples: "http://media.lawrence.com", "http://example.com/media/"
|
2013-02-16 16:19:20 +01:00
|
|
|
MEDIA_URL = '/media/'
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2012-04-14 14:51:56 +02:00
|
|
|
# Absolute path to the directory that holds static media from ``collectstatic``
|
|
|
|
# Example: "/home/media/static.lawrence.com/"
|
2014-08-16 09:25:18 +02:00
|
|
|
STATIC_ROOT = os.path.join(SITE_ROOT, '../collected-site-static')
|
2012-02-09 17:35:18 +01:00
|
|
|
|
2012-04-14 14:51:56 +02:00
|
|
|
# URL that handles the media served from STATIC_ROOT. Make sure to use a
|
|
|
|
# trailing slash if there is a path component (optional in other cases).
|
|
|
|
# Examples: "http://static.lawrence.com", "http://example.com/static/"
|
2012-11-24 14:01:21 +01:00
|
|
|
STATIC_URL = '/static/'
|
2012-04-14 14:51:56 +02:00
|
|
|
|
2012-07-08 18:09:23 +02:00
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
2013-10-13 17:17:56 +02:00
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
2012-07-08 18:09:23 +02:00
|
|
|
)
|
|
|
|
|
2015-01-05 15:01:42 +01:00
|
|
|
STATICFILES_DIRS = [
|
|
|
|
os.path.join(SITE_ROOT, 'static')]
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
MIDDLEWARE_CLASSES = (
|
|
|
|
'django.contrib.sessions.middleware.SessionMiddleware',
|
2012-12-16 17:26:53 +01:00
|
|
|
'django.middleware.locale.LocaleMiddleware',
|
|
|
|
'django.middleware.common.CommonMiddleware',
|
2012-02-09 17:35:18 +01:00
|
|
|
'django.middleware.csrf.CsrfViewMiddleware',
|
2015-01-22 22:50:19 +01:00
|
|
|
'openslides.users.auth.AuthenticationMiddleware',
|
2012-02-09 17:35:18 +01:00
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
2015-06-29 12:08:15 +02:00
|
|
|
'openslides.core.middleware.ConfigCacheMiddleware',
|
2012-02-09 17:35:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'openslides.urls'
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
2015-01-16 14:18:34 +01:00
|
|
|
'openslides.core',
|
2015-02-12 20:57:05 +01:00
|
|
|
'openslides.users',
|
2012-02-09 17:35:18 +01:00
|
|
|
'django.contrib.auth',
|
|
|
|
'django.contrib.contenttypes',
|
|
|
|
'django.contrib.sessions',
|
|
|
|
'django.contrib.messages',
|
2012-04-14 14:51:56 +02:00
|
|
|
'django.contrib.staticfiles',
|
2013-06-11 11:37:05 +02:00
|
|
|
'django.contrib.humanize',
|
2014-10-11 14:15:42 +02:00
|
|
|
'rest_framework',
|
2015-06-16 10:37:23 +02:00
|
|
|
'openslides.poll', # TODO: try to remove this line
|
2012-07-10 14:00:51 +02:00
|
|
|
'openslides.agenda',
|
2015-03-26 05:36:10 +01:00
|
|
|
'openslides.motions',
|
|
|
|
'openslides.assignments',
|
|
|
|
'openslides.mediafiles',
|
2012-02-09 17:35:18 +01:00
|
|
|
)
|
|
|
|
|
2012-10-25 15:17:25 +02:00
|
|
|
|
|
|
|
CACHES = {
|
|
|
|
'default': {
|
|
|
|
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
|
|
|
|
'LOCATION': 'openslidecache'
|
|
|
|
}
|
|
|
|
}
|
2012-11-24 15:00:17 +01:00
|
|
|
|
2013-02-27 18:22:24 +01:00
|
|
|
# Hosts/domain names that are valid for this site; required if DEBUG is False
|
|
|
|
# See https://docs.djangoproject.com/en/1.5/ref/settings/#allowed-hosts
|
|
|
|
ALLOWED_HOSTS = ['*']
|
2013-04-28 18:38:17 +02:00
|
|
|
|
2013-09-08 14:44:41 +02:00
|
|
|
# Use Haystack with Whoosh for full text search
|
|
|
|
HAYSTACK_CONNECTIONS = {
|
|
|
|
'default': {
|
|
|
|
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine'
|
|
|
|
},
|
|
|
|
}
|
2013-04-28 18:38:17 +02:00
|
|
|
|
2013-09-08 14:44:41 +02:00
|
|
|
# Haystack updates search index after each save/delete action by apps
|
2015-01-12 12:31:11 +01:00
|
|
|
HAYSTACK_SIGNAL_PROCESSOR = 'openslides.utils.haystack_processor.OpenSlidesProcessor'
|
2013-12-12 21:22:42 +01:00
|
|
|
|
|
|
|
# Adds all automaticly collected plugins
|
2014-04-28 23:37:22 +02:00
|
|
|
INSTALLED_PLUGINS = collect_plugins()
|
2014-05-11 19:10:08 +02:00
|
|
|
|
2015-02-04 00:08:38 +01:00
|
|
|
# Set this True to use tornado as single wsgi server. Set this False to use
|
|
|
|
# other webserver like Apache or Nginx as wsgi server.
|
2015-01-17 14:01:44 +01:00
|
|
|
USE_TORNADO_AS_WSGI_SERVER = True
|
2015-01-22 18:29:12 +01:00
|
|
|
|
2015-02-04 00:08:38 +01:00
|
|
|
OPENSLIDES_WSGI_NETWORK_LOCATION = ''
|
|
|
|
|
|
|
|
|
2015-01-22 18:29:12 +01:00
|
|
|
TEST_RUNNER = 'openslides.utils.test.OpenSlidesDiscoverRunner'
|
2015-01-25 01:11:14 +01:00
|
|
|
|
|
|
|
# Config for the REST Framework
|
|
|
|
REST_FRAMEWORK = {
|
2015-05-05 10:42:31 +02:00
|
|
|
'DEFAULT_AUTHENTICATION_CLASSES': (
|
|
|
|
'rest_framework.authentication.SessionAuthentication',
|
2015-09-16 00:55:27 +02:00
|
|
|
'openslides.users.auth.RESTFrameworkAnonymousAuthentication',
|
2015-05-05 10:42:31 +02:00
|
|
|
)
|
2015-01-25 01:11:14 +01:00
|
|
|
}
|