OpenSlides/openslides/global_settings.py

127 lines
3.8 KiB
Python
Raw Normal View History

import os
from django.utils.translation import ugettext_lazy
from openslides.utils.plugins import collect_plugins
2012-02-09 17:35:18 +01:00
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
AUTH_USER_MODEL = 'users.User'
AUTHENTICATION_BACKENDS = ('openslides.users.auth.CustomizedModelBackend',)
SESSION_COOKIE_NAME = 'OpenSlidesSessionID'
2012-02-09 17:35:18 +01:00
LANGUAGES = (
('cs', ugettext_lazy('Czech')),
('en', ugettext_lazy('English')),
('fr', ugettext_lazy('French')),
('de', ugettext_lazy('German')),
('pt', ugettext_lazy('Portuguese')),
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
LOCALE_PATHS = (
os.path.join(SITE_ROOT, 'locale'),
)
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/"
MEDIA_URL = '/media/'
2012-02-09 17:35:18 +01:00
# Absolute path to the directory that holds static media from ``collectstatic``
# Example: "/home/media/static.lawrence.com/"
STATIC_ROOT = os.path.join(SITE_ROOT, '../collected-site-static')
2012-02-09 17:35:18 +01: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/"
STATIC_URL = '/static/'
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
STATICFILES_DIRS = [
os.path.join(SITE_ROOT, 'static')]
2012-02-09 17:35:18 +01:00
MIDDLEWARE_CLASSES = (
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
2012-02-09 17:35:18 +01:00
'django.middleware.csrf.CsrfViewMiddleware',
'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',
'openslides.users',
2012-02-09 17:35:18 +01:00
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'django.contrib.humanize',
2014-10-11 14:15:42 +02:00
'rest_framework',
'openslides.poll', # TODO: try to remove this line
'openslides.agenda',
'openslides.motions',
'openslides.assignments',
'openslides.mediafiles',
2012-02-09 17:35:18 +01:00
)
CACHES = {
'default': {
'BACKEND': 'django.core.cache.backends.locmem.LocMemCache',
'LOCATION': 'openslidecache'
}
}
# 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 = ['*']
# Use Haystack with Whoosh for full text search
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine'
},
}
# Haystack updates search index after each save/delete action by apps
HAYSTACK_SIGNAL_PROCESSOR = 'openslides.utils.haystack_processor.OpenSlidesProcessor'
# Adds all automaticly collected plugins
INSTALLED_PLUGINS = collect_plugins()
# Set this True to use tornado as single wsgi server. Set this False to use
# other webserver like Apache or Nginx as wsgi server.
USE_TORNADO_AS_WSGI_SERVER = True
OPENSLIDES_WSGI_NETWORK_LOCATION = ''
TEST_RUNNER = 'openslides.utils.test.OpenSlidesDiscoverRunner'
# 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
)
}