2012-02-09 17:35:18 +01:00
|
|
|
|
#!/usr/bin/env python
|
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
"""
|
2013-02-16 16:19:20 +01:00
|
|
|
|
openslides.global_settings
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
2012-02-09 17:35:18 +01:00
|
|
|
|
|
|
|
|
|
OpenSlides default settings.
|
|
|
|
|
|
2013-02-16 16:19:20 +01:00
|
|
|
|
:copyright: 2011–2013 by OpenSlides team, see AUTHORS.
|
2012-02-09 17:35:18 +01:00
|
|
|
|
:license: GNU GPL, see LICENSE for more details.
|
|
|
|
|
"""
|
2012-04-25 22:29:19 +02:00
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
|
import os
|
2012-11-24 14:01:21 +01:00
|
|
|
|
from openslides.main import fs2unicode
|
2012-05-30 23:30:24 +02:00
|
|
|
|
|
2013-02-16 16:19:20 +01:00
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
|
SITE_ROOT = os.path.realpath(os.path.dirname(__file__))
|
|
|
|
|
|
2012-11-24 14:01:21 +01:00
|
|
|
|
AUTHENTICATION_BACKENDS = (
|
|
|
|
|
'django.contrib.auth.backends.ModelBackend',
|
2012-07-10 14:00:51 +02:00
|
|
|
|
'openslides.utils.auth.AnonymousAuth',)
|
2012-02-09 17:35:18 +01:00
|
|
|
|
|
|
|
|
|
LOGIN_URL = '/login/'
|
|
|
|
|
LOGIN_REDIRECT_URL = '/'
|
|
|
|
|
|
2012-07-27 23:18:31 +02:00
|
|
|
|
SESSION_COOKIE_NAME = 'OpenSlidesSessionID'
|
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
|
ugettext = lambda s: s
|
|
|
|
|
|
|
|
|
|
LANGUAGES = (
|
|
|
|
|
('de', ugettext('German')),
|
|
|
|
|
('en', ugettext('English')),
|
2012-11-07 22:24:39 +01:00
|
|
|
|
('fr', ugettext('French')),
|
2013-07-26 21:37:58 +02:00
|
|
|
|
('cs', ugettext('Czech')),
|
2013-09-24 22:13:50 +02:00
|
|
|
|
('pt', ugettext('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
|
|
|
|
|
|
2012-08-05 22:35:09 +02:00
|
|
|
|
LOCALE_PATHS = (
|
2012-11-24 14:01:21 +01:00
|
|
|
|
fs2unicode(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/"
|
2013-02-16 16:19:20 +01:00
|
|
|
|
STATIC_ROOT = fs2unicode(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
|
|
|
|
|
|
|
|
|
# Additional directories containing static files (not application specific)
|
|
|
|
|
# Examples: "/home/media/lawrence.com/extra-static/"
|
|
|
|
|
STATICFILES_DIRS = (
|
2012-11-24 14:01:21 +01:00
|
|
|
|
fs2unicode(os.path.join(SITE_ROOT, 'static')),
|
2012-04-14 14:51:56 +02:00
|
|
|
|
)
|
2012-02-09 17:35:18 +01:00
|
|
|
|
|
2012-07-08 18:09:23 +02:00
|
|
|
|
STATICFILES_FINDERS = (
|
|
|
|
|
'django.contrib.staticfiles.finders.FileSystemFinder',
|
2013-09-25 12:53:44 +02:00
|
|
|
|
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
|
2012-07-08 18:09:23 +02:00
|
|
|
|
)
|
|
|
|
|
|
2012-02-09 17:35:18 +01:00
|
|
|
|
MESSAGE_STORAGE = 'django.contrib.messages.storage.cookie.CookieStorage'
|
|
|
|
|
|
|
|
|
|
# List of callables that know how to import templates from various sources.
|
|
|
|
|
TEMPLATE_LOADERS = (
|
|
|
|
|
'django.template.loaders.filesystem.Loader',
|
|
|
|
|
'django.template.loaders.app_directories.Loader',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
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',
|
2012-08-12 10:12:26 +02:00
|
|
|
|
'openslides.participant.middleware.AuthenticationMiddleware',
|
2012-02-09 17:35:18 +01:00
|
|
|
|
'django.contrib.messages.middleware.MessageMiddleware',
|
2013-03-01 17:13:12 +01:00
|
|
|
|
'openslides.config.middleware.ConfigCacheMiddleware',
|
2012-02-09 17:35:18 +01:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
ROOT_URLCONF = 'openslides.urls'
|
|
|
|
|
|
|
|
|
|
TEMPLATE_DIRS = (
|
2012-07-10 14:00:51 +02:00
|
|
|
|
# Put strings here, like "/home/html/django_templates" or
|
|
|
|
|
# "C:/www/django/templates".
|
2012-02-09 17:35:18 +01:00
|
|
|
|
# Always use forward slashes, even on Windows.
|
|
|
|
|
# Don't forget to use absolute paths, not relative paths.
|
2012-11-24 14:01:21 +01:00
|
|
|
|
fs2unicode(os.path.join(SITE_ROOT, 'templates')),
|
2012-02-09 17:35:18 +01:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
INSTALLED_APPS = (
|
|
|
|
|
'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',
|
2012-02-20 00:14:54 +01:00
|
|
|
|
'mptt',
|
2012-07-10 14:00:51 +02:00
|
|
|
|
'openslides.poll',
|
2013-03-01 17:13:12 +01:00
|
|
|
|
'openslides.core',
|
2013-04-02 17:40:57 +02:00
|
|
|
|
'openslides.account',
|
2012-07-10 14:00:51 +02:00
|
|
|
|
'openslides.projector',
|
|
|
|
|
'openslides.agenda',
|
2012-10-24 11:04:23 +02:00
|
|
|
|
'openslides.motion',
|
2012-07-10 14:00:51 +02:00
|
|
|
|
'openslides.assignment',
|
|
|
|
|
'openslides.participant',
|
2013-02-16 16:19:20 +01:00
|
|
|
|
'openslides.mediafile',
|
2012-07-10 14:00:51 +02:00
|
|
|
|
'openslides.config',
|
2012-02-09 17:35:18 +01:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
TEMPLATE_CONTEXT_PROCESSORS = (
|
|
|
|
|
'django.contrib.auth.context_processors.auth',
|
|
|
|
|
'django.contrib.messages.context_processors.messages',
|
|
|
|
|
'django.core.context_processors.request',
|
|
|
|
|
'django.core.context_processors.i18n',
|
2012-04-14 14:51:56 +02:00
|
|
|
|
'django.core.context_processors.static',
|
2012-04-14 09:49:37 +02:00
|
|
|
|
'openslides.utils.auth.anonymous_context_additions',
|
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
|
|
|
|
|
|
|
|
|
TEST_RUNNER = 'discover_runner.DiscoverRunner'
|
|
|
|
|
TEST_DISCOVER_TOP_LEVEL = os.path.dirname(os.path.dirname(__file__))
|
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 = ['*']
|