| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | """
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | Copyright 2015 Ungleich. | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | """
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 20:57:22 -06:00
										 |  |  | # -*- coding: utf-8 -*- | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | # Build paths inside the project like this: os.path.join(BASE_DIR, ...) | 
					
						
							|  |  |  | import os | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | import logging | 
					
						
							| 
									
										
										
										
											2015-05-14 01:24:40 +02:00
										 |  |  | import django.db.backends.postgresql_psycopg2 | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 20:57:22 -06:00
										 |  |  | gettext = lambda s: s | 
					
						
							|  |  |  | BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Quick-start development settings - unsuitable for production | 
					
						
							| 
									
										
										
										
											2015-05-20 23:33:10 -06:00
										 |  |  | # See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/ | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-21 01:21:08 -06:00
										 |  |  | SITE_ID = 1 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 23:33:10 -06:00
										 |  |  | APP_ROOT_ENDPOINT = "/" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 23:34:24 -06:00
										 |  |  | LOGIN_URL = None | 
					
						
							|  |  |  | LOGOUT_URL = None | 
					
						
							|  |  |  | LOGIN_REDIRECT_URL = None | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | # SECURITY WARNING: keep the secret key used in production secret! | 
					
						
							|  |  |  | SECRET_KEY = 'xlhyv_l5-z6e8_@q6)n0up1a0$5-aad7d)om2t8g$bi6*@q44i' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # SECURITY WARNING: don't run with debug turned on in production! | 
					
						
							| 
									
										
										
										
											2015-05-14 01:19:55 +02:00
										 |  |  | DEBUG = False | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-14 01:19:55 +02:00
										 |  |  | ALLOWED_HOSTS = [ | 
					
						
							| 
									
										
										
										
											2015-05-20 20:57:22 -06:00
										 |  |  |     ".ungleich.ch", | 
					
						
							| 
									
										
										
										
											2015-05-14 01:19:55 +02:00
										 |  |  |     "digital.glarus.ungleich.ch" ] | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Application definition | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | INSTALLED_APPS = ( | 
					
						
							|  |  |  |     'django.contrib.admin', | 
					
						
							|  |  |  |     'django.contrib.auth', | 
					
						
							|  |  |  |     'django.contrib.contenttypes', | 
					
						
							|  |  |  |     'django.contrib.sessions', | 
					
						
							|  |  |  |     'django.contrib.messages', | 
					
						
							|  |  |  |     'django.contrib.staticfiles', | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  |     'django.contrib.sites', | 
					
						
							| 
									
										
										
										
											2015-05-20 22:06:24 -06:00
										 |  |  |     'cms',  # django CMS itself | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     'digital_glarus', | 
					
						
							| 
									
										
										
										
											2015-05-20 22:06:24 -06:00
										 |  |  |     'treebeard',  # utilities for implementing a tree | 
					
						
							|  |  |  |     'menus',  # helper for model independent hierarchical website navigation | 
					
						
							|  |  |  |     'sekizai',  # for javascript and css management | 
					
						
							|  |  |  |     'djangocms_admin_style',  # for the admin skin. You **must** add 'djangocms_admin_style' in the list **before** 'django.contrib.admin'. | 
					
						
							|  |  |  |     #django-cms plugins | 
					
						
							|  |  |  |     'djangocms_flash', | 
					
						
							|  |  |  |     'djangocms_googlemap', | 
					
						
							|  |  |  |     'djangocms_inherit', | 
					
						
							|  |  |  |     'djangocms_link', | 
					
						
							|  |  |  |     'djangocms_snippet', | 
					
						
							|  |  |  |     'djangocms_teaser', | 
					
						
							|  |  |  |     #django-filer | 
					
						
							|  |  |  |     'cmsplugin_filer_file', | 
					
						
							|  |  |  |     'cmsplugin_filer_folder', | 
					
						
							|  |  |  |     'cmsplugin_filer_link', | 
					
						
							|  |  |  |     'cmsplugin_filer_teaser', | 
					
						
							|  |  |  |     'cmsplugin_filer_video', | 
					
						
							|  |  |  |     # versioning | 
					
						
							|  |  |  |     'reversion', | 
					
						
							|  |  |  |     #ck-editor | 
					
						
							|  |  |  |     'djangocms_text_ckeditor', | 
					
						
							|  |  |  |     # djangocms-blog | 
					
						
							|  |  |  |     'filer', | 
					
						
							|  |  |  |     'easy_thumbnails', | 
					
						
							|  |  |  |     'cmsplugin_filer_image', | 
					
						
							|  |  |  |     'parler', | 
					
						
							|  |  |  |     'taggit', | 
					
						
							|  |  |  |     'taggit_autosuggest', | 
					
						
							|  |  |  |     'django_select2', | 
					
						
							|  |  |  |     'meta', | 
					
						
							|  |  |  |     'meta_mixin', | 
					
						
							|  |  |  |     'admin_enhancer', | 
					
						
							|  |  |  |     'djangocms_blog' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | MIDDLEWARE_CLASSES = ( | 
					
						
							|  |  |  |     'django.contrib.sessions.middleware.SessionMiddleware', | 
					
						
							|  |  |  |     'django.middleware.common.CommonMiddleware', | 
					
						
							|  |  |  |     'django.middleware.csrf.CsrfViewMiddleware', | 
					
						
							|  |  |  |     'django.contrib.auth.middleware.AuthenticationMiddleware', | 
					
						
							|  |  |  |     'django.contrib.auth.middleware.SessionAuthenticationMiddleware', | 
					
						
							|  |  |  |     'django.contrib.messages.middleware.MessageMiddleware', | 
					
						
							|  |  |  |     'django.middleware.clickjacking.XFrameOptionsMiddleware', | 
					
						
							| 
									
										
										
										
											2015-05-21 01:21:08 -06:00
										 |  |  |     'django.middleware.locale.LocaleMiddleware', | 
					
						
							| 
									
										
										
										
											2015-05-20 22:39:30 -06:00
										 |  |  |     # django-cms middlewares | 
					
						
							|  |  |  |     'cms.middleware.user.CurrentUserMiddleware', | 
					
						
							|  |  |  |     'cms.middleware.page.CurrentPageMiddleware', | 
					
						
							|  |  |  |     'cms.middleware.toolbar.ToolbarMiddleware', | 
					
						
							|  |  |  |     'cms.middleware.language.LanguageCookieMiddleware', | 
					
						
							|  |  |  |     # /djangocms-middlewares | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ROOT_URLCONF = 'dynamicweb.urls' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | TEMPLATES = [ | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         'BACKEND': 'django.template.backends.django.DjangoTemplates', | 
					
						
							|  |  |  |         'DIRS': [], | 
					
						
							|  |  |  |         'APP_DIRS': True, | 
					
						
							|  |  |  |         'OPTIONS': { | 
					
						
							|  |  |  |             'context_processors': [ | 
					
						
							|  |  |  |                 'django.template.context_processors.debug', | 
					
						
							|  |  |  |                 'django.template.context_processors.request', | 
					
						
							|  |  |  |                 'django.contrib.auth.context_processors.auth', | 
					
						
							|  |  |  |                 'django.contrib.messages.context_processors.messages', | 
					
						
							|  |  |  |             ], | 
					
						
							|  |  |  |         }, | 
					
						
							|  |  |  |     }, | 
					
						
							|  |  |  | ] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | WSGI_APPLICATION = 'dynamicweb.wsgi.application' | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | # Deprecated since version 1.8. | 
					
						
							|  |  |  | # callables take a request object as their argument and return a dictionary of | 
					
						
							|  |  |  | # items to be merged into the context. | 
					
						
							|  |  |  | TEMPLATE_CONTEXT_PROCESSORS = ( | 
					
						
							|  |  |  |     "django.contrib.auth.context_processors.auth", | 
					
						
							| 
									
										
										
										
											2015-05-21 01:24:56 -06:00
										 |  |  |     "django.core.context_processors.debug", | 
					
						
							|  |  |  |     "django.core.context_processors.i18n", | 
					
						
							|  |  |  |     "django.core.context_processors.media", | 
					
						
							|  |  |  |     "django.core.context_processors.static", | 
					
						
							|  |  |  |     "django.core.context_processors.tz", | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  |     "django.contrib.messages.context_processors.messages", | 
					
						
							|  |  |  |     "django.core.context_processors.request", | 
					
						
							| 
									
										
										
										
											2015-05-20 22:42:05 -06:00
										 |  |  |     'sekizai.context_processors.sekizai', | 
					
						
							|  |  |  |     'cms.context_processors.cms_settings', | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | ) | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Database | 
					
						
							|  |  |  | # https://docs.djangoproject.com/en/1.8/ref/settings/#databases | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | DATABASES = { | 
					
						
							|  |  |  |     'default': { | 
					
						
							| 
									
										
										
										
											2015-05-14 01:22:20 +02:00
										 |  |  |         'ENGINE': 'django.db.backends.postgresql_psycopg2', | 
					
						
							|  |  |  |         'NAME': 'app', | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  |     } | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Internationalization | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | # https://docs.djangoproject.com/en/1.7/topics/i18n/ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | LANGUAGES = ( | 
					
						
							|  |  |  |     ('en', 'English'), | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | LANGUAGE_CODE = 'en' | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | TIME_ZONE = 'UTC' | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USE_I18N = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USE_L10N = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | USE_TZ = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | try: | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     from dynamicweb.local.local_settings import * | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | except ImportError: | 
					
						
							|  |  |  |     logging.warning("No local_settings file found.") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | if not APP_ROOT_ENDPOINT.endswith('/'): | 
					
						
							|  |  |  |     APP_ROOT += '/' | 
					
						
							|  |  |  | if LOGIN_URL is None: | 
					
						
							| 
									
										
										
										
											2015-05-20 23:33:10 -06:00
										 |  |  |     LOGIN_URL = APP_ROOT_ENDPOINT + 'accounts/login/' | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | if LOGOUT_URL is None: | 
					
						
							|  |  |  |     LOGOUT_URL = APP_ROOT_ENDPOINT + 'accounts/logout/' | 
					
						
							|  |  |  | if LOGIN_REDIRECT_URL is None: | 
					
						
							|  |  |  |     LOGIN_REDIRECT_URL = APP_ROOT_ENDPOINT | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Static files (CSS, JavaScript, Images) | 
					
						
							| 
									
										
										
										
											2015-05-20 22:38:22 -06:00
										 |  |  | # https://docs.djangoproject.com/en/1.7/howto/static-files/ | 
					
						
							| 
									
										
										
										
											2015-05-02 01:30:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | STATIC_URL = '/static/' | 
					
						
							| 
									
										
										
										
											2015-05-12 23:44:30 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | STATIC_ROOT = os.path.join(BASE_DIR, 'static') | 
					
						
							| 
									
										
										
										
											2015-05-14 01:19:55 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | # Media files. | 
					
						
							| 
									
										
										
										
											2015-05-20 23:36:08 -06:00
										 |  |  | MEDIA_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'media')) | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | MEDIA_URL = APP_ROOT_ENDPOINT + 'media/' | 
					
						
							| 
									
										
										
										
											2015-05-20 20:57:22 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 22:57:00 -06:00
										 |  |  | # Templates confs | 
					
						
							|  |  |  | TEMPLATE_DIRS = ( | 
					
						
							|  |  |  |     os.path.join(BASE_DIR, "templates"), | 
					
						
							|  |  |  | ) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # TODO: Configure it later. | 
					
						
							|  |  |  | CMS_TEMPLATES = ( | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  | META_SITE_PROTOCOL = 'http' | 
					
						
							|  |  |  | META_USE_SITES = True | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  | MIGRATION_MODULES = { | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     'cms': 'cms.migrations', | 
					
						
							|  |  |  |     'filer': 'filer.migrations_django', | 
					
						
							|  |  |  |     'menus': 'menus.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  |     'djangocms_flash': 'djangocms_flash.migrations_django', | 
					
						
							|  |  |  |     'djangocms_googlemap': 'djangocms_googlemap.migrations_django', | 
					
						
							|  |  |  |     'djangocms_inherit': 'djangocms_inherit.migrations_django', | 
					
						
							|  |  |  |     'djangocms_link': 'djangocms_link.migrations_django', | 
					
						
							|  |  |  |     'djangocms_snippet': 'djangocms_snippet.migrations_django', | 
					
						
							|  |  |  |     'djangocms_teaser': 'djangocms_teaser.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     'djangocms_column': 'djangocms_column.migrations_django', | 
					
						
							|  |  |  |     'djangocms_flash': 'djangocms_flash.migrations_django', | 
					
						
							|  |  |  |     'djangocms_googlemap': 'djangocms_googlemap.migrations_django', | 
					
						
							|  |  |  |     'djangocms_inherit': 'djangocms_inherit.migrations_django', | 
					
						
							|  |  |  |     'djangocms_style': 'djangocms_style.migrations_django', | 
					
						
							|  |  |  |     'cmsplugin_filer_image': 'cmsplugin_filer_image.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  |     'cmsplugin_filer_file': 'cmsplugin_filer_file.migrations_django', | 
					
						
							|  |  |  |     'cmsplugin_filer_folder': 'cmsplugin_filer_folder.migrations_django', | 
					
						
							|  |  |  |     'cmsplugin_filer_link': 'cmsplugin_filer_link.migrations_django', | 
					
						
							|  |  |  |     'cmsplugin_filer_teaser': 'cmsplugin_filer_teaser.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     'cmsplugin_filer_utils': 'cmsplugin_filer_utils.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  |     'cmsplugin_filer_video': 'cmsplugin_filer_video.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-21 01:10:54 -06:00
										 |  |  |     'djangocms_text_ckeditor': 'djangocms_text_ckeditor.migrations_django', | 
					
						
							| 
									
										
										
										
											2015-05-20 23:23:45 -06:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | THUMBNAIL_PROCESSORS = ( | 
					
						
							|  |  |  |     'easy_thumbnails.processors.colorspace', | 
					
						
							|  |  |  |     'easy_thumbnails.processors.autocrop', | 
					
						
							|  |  |  |     'filer.thumbnail_processors.scale_and_crop_with_subject_location', | 
					
						
							|  |  |  |     'easy_thumbnails.processors.filters', | 
					
						
							|  |  |  | ) | 
					
						
							| 
									
										
										
										
											2015-05-20 23:24:49 -06:00
										 |  |  | 
 | 
					
						
							|  |  |  | # django-cms-text-ckeditor | 
					
						
							|  |  |  | TEXT_SAVE_IMAGE_FUNCTION='cmsplugin_filer_image.integrations.ckeditor.create_image_plugin' |