2012-02-09 17:35:18 +01:00
|
|
|
import os
|
2014-05-11 19:10:08 +02:00
|
|
|
import copy
|
2013-11-24 09:58:48 +01:00
|
|
|
|
|
|
|
from django.utils.translation import ugettext_lazy
|
|
|
|
|
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'
|
|
|
|
|
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
|
|
|
LANGUAGES = (
|
2013-11-24 09:58:48 +01:00
|
|
|
('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
|
|
|
|
|
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
|
|
|
# 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',
|
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',
|
2013-03-01 17:13:12 +01:00
|
|
|
'openslides.config.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',
|
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',
|
2012-02-20 00:14:54 +01:00
|
|
|
'mptt',
|
2013-09-08 14:44:41 +02:00
|
|
|
'haystack', # full-text-search
|
2014-05-11 19:10:08 +02:00
|
|
|
'ckeditor',
|
2014-10-11 14:15:42 +02:00
|
|
|
'rest_framework',
|
2012-07-10 14:00:51 +02:00
|
|
|
'openslides.poll',
|
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',
|
2014-10-11 14:34:49 +02:00
|
|
|
'openslides.users',
|
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 = (
|
2015-01-22 22:50:19 +01:00
|
|
|
'openslides.users.auth.auth',
|
2012-02-09 17:35:18 +01:00
|
|
|
'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',
|
2013-12-09 23:56:01 +01:00
|
|
|
'openslides.utils.main_menu.main_menu_entries',
|
2013-12-09 18:03:47 +01:00
|
|
|
'openslides.core.chatbox.chat_messages_context_processor',
|
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
|
|
|
|
|
|
|
# CKeditor settings
|
|
|
|
CKEDITOR_DEFAULT_CONFIG = {'toolbar': 'Full',
|
|
|
|
'bodyClass': 'ckeditor_html',
|
|
|
|
'allowedContent':
|
|
|
|
'h1 h2 h3 pre b i u strike em; '
|
|
|
|
|
|
|
|
# A workaround for the problem described in http://dev.ckeditor.com/ticket/10192
|
|
|
|
# Hopefully, the problem will be solved in the final version of CKEditor 4.1
|
|
|
|
# If so, then {margin-left} can be removed
|
|
|
|
'p{margin-left}; '
|
|
|
|
|
|
|
|
'a[!href]; '
|
|
|
|
'ol ul{list-style}; '
|
|
|
|
'li; '
|
2014-06-19 12:02:29 +02:00
|
|
|
'pre; '
|
2014-05-11 19:10:08 +02:00
|
|
|
'span{color,background-color}; ',
|
|
|
|
'removePlugins': 'save, print, preview, pagebreak, templates, showblocks, magicline',
|
2014-06-19 12:02:29 +02:00
|
|
|
'extraPlugins': 'insertpre', # see http://ckeditor.com/addon/insertpre
|
2014-05-11 19:10:08 +02:00
|
|
|
'toolbar_Full': [
|
|
|
|
{'name': 'document', 'items': ['Source', '-', 'Save', 'DocProps', 'Preview', 'Print', '-', 'Templates']},
|
|
|
|
{'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
|
|
|
|
{'name': 'editing', 'items': ['Find', 'Replace', '-', 'SpellChecker', 'Scayt']},
|
|
|
|
{'name': 'basicstyles', 'items': ['Bold', 'Italic', 'Underline', 'Strike', '-', 'RemoveFormat']},
|
2014-06-19 12:02:29 +02:00
|
|
|
{'name': 'paragraph', 'items': ['NumberedList', 'BulletedList', '-', 'InsertPre']},
|
2014-05-11 19:10:08 +02:00
|
|
|
{'name': 'links', 'items': ['Link', 'Unlink']},
|
|
|
|
{'name': 'styles', 'items': ['Format', 'TextColor', 'BGColor']},
|
|
|
|
{'name': 'tools', 'items': ['Maximize', 'ShowBlocks', '-', 'About']}
|
|
|
|
]}
|
|
|
|
CKEDITOR_IMG_CONFIG = copy.deepcopy(CKEDITOR_DEFAULT_CONFIG)
|
|
|
|
CKEDITOR_IMG_CONFIG['allowedContent'] += 'img; '
|
|
|
|
CKEDITOR_IMG_CONFIG['toolbar_Full'].append({'name': 'images', 'items': ['Image']})
|
|
|
|
|
|
|
|
CKEDITOR_UPLOAD_PATH = 'ckeditor'
|
|
|
|
CKEDITOR_CONFIGS = {
|
|
|
|
'default': CKEDITOR_DEFAULT_CONFIG,
|
|
|
|
'images': CKEDITOR_IMG_CONFIG,
|
|
|
|
}
|
2015-01-17 14:01:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Use small alternative with tornado as frontend or big alternative with a
|
|
|
|
# webserver as wsgi server.
|
|
|
|
USE_TORNADO_AS_WSGI_SERVER = True
|
2015-01-22 18:29:12 +01:00
|
|
|
|
|
|
|
TEST_RUNNER = 'openslides.utils.test.OpenSlidesDiscoverRunner'
|