text: """
  Django settings for mmc project.
  
  For the full list of settings and their values, see
  https://docs.djangoproject.com/en/dev/ref/settings/
  
  For production settings see
  https://docs.djangoproject.com/en/dev/howto/deployment/checklist/
  """
  import getpass
  import logging
  import os
  
  from ddhldap.settings import *  # noqa
  
  # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
  
  PROJECT_NAME = "mmc"
  PROJECT_TITLE = "Mozart and Material Culture"
  
  # -----------------------------------------------------------------------------
  # Core Settings
  # https://docs.djangoproject.com/en/dev/ref/settings/#id6
  # -----------------------------------------------------------------------------
  
  ADMINS = ()
  MANAGERS = ADMINS
  
  ALLOWED_HOSTS = []
  
  # https://docs.djangoproject.com/en/dev/ref/settings/#caches
  # https://docs.djangoproject.com/en/dev/topics/cache/
  # http://redis.io/topics/lru-cache
  # http://niwibe.github.io/django-redis/
  CACHE_REDIS_DATABASE = "0"
  
  CACHES = {
      "default": {
          "BACKEND": "django_redis.cache.RedisCache",
          "LOCATION": "redis://127.0.0.1:6379/" + CACHE_REDIS_DATABASE,
          "OPTIONS": {
              "CLIENT_CLASS": "django_redis.client.DefaultClient",
              "IGNORE_EXCEPTIONS": True,
          },
      }
  }
  
  CSRF_COOKIE_SECURE = True
  CSRF_COOKIE_HTTPONLY = True
  
  # https://docs.djangoproject.com/en/dev/ref/settings/#databases
  DATABASES = {}
  
  # SECURITY WARNING: don't run with debug turned on in production!
  DEBUG = False
  TEMPLATE_DEBUG = False
  
  INSTALLED_APPS = (
      "django.contrib.admin",
      "django.contrib.auth",
      "django.contrib.contenttypes",
      "django.contrib.sessions",
      "django.contrib.messages",
      "django.contrib.staticfiles",
      "rest_framework",
      "taggit",
      "compressor",
      "wagtail.contrib.forms",
      "wagtail.contrib.redirects",
      "wagtail.contrib.routable_page",
      "wagtail.contrib.table_block",
      "wagtail.embeds",
      "wagtail.sites",
      "wagtail.users",
      "wagtail.snippets",
      "wagtail.documents",
      "wagtail.images",
      "wagtail.search",
      "wagtail.admin",
      "wagtail.core",
  )
  
  INSTALLED_APPS += (
      # your project apps here
      "ddhldap",
      "cms",
      # 'activecollab_digger',
  )
  
  INTERNAL_IPS = ("127.0.0.1",)
  
  # https://docs.djangoproject.com/en/dev/topics/logging/
  LOGGING_ROOT = os.path.join(BASE_DIR, "logs")
  LOGGING_LEVEL = logging.WARN
  
  if not os.path.exists(LOGGING_ROOT):
      os.makedirs(LOGGING_ROOT)
  
  LOGGING = {
      "version": 1,
      "disable_existing_loggers": False,
      "formatters": {
          "verbose": {
              "format": (
                  "%(levelname)s %(asctime)s %(module)s "
                  "%(process)d %(thread)d %(message)s"
              )
          },
          "simple": {"format": "%(levelname)s %(message)s"},
      },
      "handlers": {
          "file": {
              "level": "DEBUG",
              "class": "logging.handlers.TimedRotatingFileHandler",
              "filename": os.path.join(LOGGING_ROOT, "django.log"),
              "formatter": "verbose",
          },
          "console": {
              "level": "DEBUG",
              "class": "logging.StreamHandler",
              "formatter": "simple",
          },
          "mail_admins": {
              "level": "ERROR",
              "class": "django.utils.log.AdminEmailHandler",
          },
      },
      "loggers": {
          "django": {
              "handlers": ["file", "mail_admins"],
              "level": LOGGING_LEVEL,
              "propagate": True,
          },
          "django_auth_ldap": {
              "handlers": ["file"],
              "level": LOGGING_LEVEL,
              "propagate": True,
          },
          "mmc": {"handlers": ["file"], "level": LOGGING_LEVEL, "propagate": True},
      },
  }
  
  
  MIDDLEWARE = (
      "django.middleware.security.SecurityMiddleware",
      "django.contrib.sessions.middleware.SessionMiddleware",
      "django.middleware.locale.LocaleMiddleware",
      "django.middleware.common.CommonMiddleware",
      "django.middleware.csrf.CsrfViewMiddleware",
      "django.contrib.auth.middleware.AuthenticationMiddleware",
      "django.contrib.messages.middleware.MessageMiddleware",
      "django.middleware.common.BrokenLinkEmailsMiddleware",
      "django.middleware.clickjacking.XFrameOptionsMiddleware",
      "wagtail.contrib.redirects.middleware.RedirectMiddleware",
  )
  
  ROOT_URLCONF = PROJECT_NAME + ".urls"
  
  # SECURITY WARNING: keep the secret key used in production secret!
  SECRET_KEY = ""
  
  WAGTAIL_SITE_NAME = PROJECT_TITLE
  
  ITEMS_PER_PAGE = 25
  
  
  TEMPLATES = [
      {
          "BACKEND": "django.template.backends.django.DjangoTemplates",
          "DIRS": [os.path.join(BASE_DIR, "templates")],
          "APP_DIRS": True,
          "OPTIONS": {
              "context_processors": [
                  "django.contrib.auth.context_processors.auth",
                  "django.template.context_processors.debug",
                  "django.template.context_processors.media",
                  "django.template.context_processors.request",
                  "django.template.context_processors.static",
                  "django.contrib.messages.context_processors.messages",
                  # 'activecollab_digger.context_processors.activecollab_digger',
              ],
              "debug": False,
          },
      },
  ]
  
  # https://docs.djangoproject.com/en/dev/topics/i18n/
  LANGUAGE_CODE = "en-gb"
  TIME_ZONE = "Europe/London"
  USE_I18N = True
  USE_L10N = False
  USE_TZ = True
  
  WSGI_APPLICATION = PROJECT_NAME + ".wsgi.application"
  
  # -----------------------------------------------------------------------------
  # Authentication
  # https://docs.djangoproject.com/en/dev/ref/settings/#auth
  # https://scm.cch.kcl.ac.uk/hg/ddhldap-django
  # -----------------------------------------------------------------------------
  
  AUTH_LDAP_REQUIRE_GROUP = "cn=mmc," + LDAP_BASE_OU
  
  AUTH_LDAP_ALWAYS_UPDATE_USER = False
  
  AUTH_LDAP_CACHE_GROUPS = True
  
  
  # -----------------------------------------------------------------------------
  # Static files (CSS, JavaScript, Images)
  # https://docs.djangoproject.com/en/dev/howto/static-files/
  # https://docs.djangoproject.com/en/dev/ref/settings/#static-files
  # -----------------------------------------------------------------------------
  
  STATIC_URL = "/static/"
  STATIC_ROOT = os.path.join(BASE_DIR, STATIC_URL.strip("/"))
  
  if not os.path.exists(STATIC_ROOT):
      os.makedirs(STATIC_ROOT)
  
  STATICFILES_DIRS = (
      os.path.join(BASE_DIR, "assets"),
      os.path.join(BASE_DIR, "node_modules"),
  )
  
  STATICFILES_FINDERS = (
      "django.contrib.staticfiles.finders.FileSystemFinder",
      "django.contrib.staticfiles.finders.AppDirectoriesFinder",
      "compressor.finders.CompressorFinder",
  )
  
  MEDIA_URL = "/media/"
  MEDIA_ROOT = os.path.join(BASE_DIR, MEDIA_URL.strip("/"))
  
  if not os.path.exists(MEDIA_ROOT):
      os.makedirs(MEDIA_ROOT)
  
  # -----------------------------------------------------------------------------
  # EMAIL SETTINGS
  # -----------------------------------------------------------------------------
  
  EMAIL_HOST = "smtp.kcl.ac.uk"
  EMAIL_PORT = 25
  EMAIL_HOST_USER = ""
  EMAIL_HOST_PASSWORD = ""
  EMAIL_USE_TLS = False
  DEFAULT_FROM_EMAIL = "noreply@kcl.ac.uk"
  # Sender of error messages to ADMINS and MANAGERS
  SERVER_EMAIL = DEFAULT_FROM_EMAIL
  EMAIL_SUBJECT_PREFIX = "[Django {}] ".format(PROJECT_NAME)
  
  # -----------------------------------------------------------------------------
  # Sessions
  # https://docs.djangoproject.com/en/1.8/ref/settings/#sessions
  # -----------------------------------------------------------------------------
  
  SESSION_COOKIE_SECURE = True
  
  # -----------------------------------------------------------------------------
  # Installed Applications Settings
  # -----------------------------------------------------------------------------
  
  # -----------------------------------------------------------------------------
  # Django Compressor
  # http://django-compressor.readthedocs.org/en/latest/
  # -----------------------------------------------------------------------------
  
  COMPRESS_ENABLED = True
  
  COMPRESS_CSS_FILTERS = [
      # CSS minimizer
      "compressor.filters.cssmin.CSSMinFilter"
  ]
  
  COMPRESS_PRECOMPILERS = (("text/x-scss", "django_libsass.SassCompiler"),)
  
  
  # -----------------------------------------------------------------------------
  # FABRIC
  # -----------------------------------------------------------------------------
  
  FABRIC_USER = getpass.getuser()
  
  # -----------------------------------------------------------------------------
  # GLOBALS FOR JS
  # -----------------------------------------------------------------------------
  
  # Google Analytics ID
  GA_ID = "UA-67707155-5"
  
  WAGTAILSEARCH_RESULTS_TEMPLATE = "cms/search_results.html"
  
  # ActiveCollab API URL
  AC_BASE_URL = "https://app.activecollab.com/148987"
  AC_API_URL = AC_BASE_URL + "/api/v1/"
  # ActiveCollab API token
  AC_TOKEN = ""
  # ActiveCollab project ID
  AC_PROJECT_ID = 769
  # ActiveCollab user ID to create the issues
  AC_USER = 36
  
  LOGIN_URL = "/wagtail/login/"
  