text: from .base import *  # flake8: noqa
  
  
  DEBUG = env.bool('DJANGO_DEBUG', default=False)
  
  TEMPLATES[0]['OPTIONS']['debug'] = DEBUG
  
  SECRET_KEY = env('DJANGO_SECRET_KEY')
  
  # Compress static files offline
  # http://django-compressor.readthedocs.org/en/latest/settings/#django.conf.settings.COMPRESS_OFFLINE
  
  COMPRESS_OFFLINE = True
  
  COMPRESS_CSS_FILTERS = [
      'compressor.filters.css_default.CssAbsoluteFilter',
      'compressor.filters.cssmin.CSSMinFilter',
  ]
  
  ALLOWED_HOSTS = [env("DJANGO_ALLOWED_HOST_NAME"), ]
  
  DATABASES['default'] = env.db('PROD_DATABASE_URL')
  
  INSTALLED_APPS += (
      "wagtail.contrib.frontend_cache",
      'gunicorn',
  )
  
  MIDDLEWARE_CLASSES = (
      'django.contrib.sessions.middleware.SessionMiddleware',
      'django.middleware.common.CommonMiddleware',
      'django.middleware.csrf.CsrfViewMiddleware',
      'django.contrib.auth.middleware.AuthenticationMiddleware',
      'django.contrib.messages.middleware.MessageMiddleware',
      'django.middleware.clickjacking.XFrameOptionsMiddleware',
  
      'wagtail.core.middleware.SiteMiddleware',
      'wagtail.contrib.redirects.middleware.RedirectMiddleware',
  )
  
  WAGTAIL_SITE_NAME = '{{ cookiecutter.project_name }}'
  
  # Send notification emails as a background task using Celery,
  # to prevent this from blocking web server threads
  # (requires the django-celery package):
  # http://celery.readthedocs.org/en/latest/configuration.html
  
  # import djcelery
  #
  # djcelery.setup_loader()
  #
  # CELERY_SEND_TASK_ERROR_EMAILS = True
  # BROKER_URL = 'redis://'
  
  
  # Use Redis as the cache backend for extra performance
  # (requires the django-redis-cache package):
  # http://wagtail.readthedocs.org/en/latest/howto/performance.html#cache
  
  CACHES = {
      'default': {
          'BACKEND': 'django_redis.cache.RedisCache',
          'LOCATION': '{0}/{1}'.format(env('REDIS_URL', default='redis://127.0.0.1:6379'), 0),
          'OPTIONS': {
              'CLIENT_CLASS': 'django_redis.client.DefaultClient',
              'IGNORE_EXCEPTIONS': True,
          }
      }
  }
  
  DEFAULT_FROM_EMAIL =  env('EMAIL_FROM')
  EMAIL_USE_TLS = True
  EMAIL_HOST = env("EMAIL_HOST")
  EMAIL_HOST_USER = env('EMAIL_USER')
  EMAIL_HOST_PASSWORD = env('EMAIL_PASSWD')
  EMAIL_PORT = 587
  
  # LOGGING CONFIGURATION
  # Sends an email to site admins on every HTTP 500 error when DEBUG=False.
  # See http://docs.djangoproject.com/en/dev/topics/logging for
  # more details on how to customize your logging configuration.
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'filters': {
          'require_debug_false': {
              '()': 'django.utils.log.RequireDebugFalse'
          }
      },
      'formatters': {
          'verbose': {
              'format': '%(levelname)s %(asctime)s %(module)s '
                        '%(process)d %(thread)d %(message)s'
          },
      },
      'handlers': {
          'mail_admins': {
              'level': 'ERROR',
              'filters': ['require_debug_false'],
              'class': 'django.utils.log.AdminEmailHandler'
          },
          'console': {
              'level': 'DEBUG',
              'class': 'logging.StreamHandler',
              'formatter': 'verbose',
          },
      },
      'loggers': {
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': True
          },
          'django.security.DisallowedHost': {
              'level': 'ERROR',
              'handlers': ['console', 'mail_admins'],
              'propagate': True
          }
      }
  }