text: import json
  import os
  
  from django.core.exceptions import ImproperlyConfigured
  
  BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
  
  with open(os.path.join(BASE_DIR, 'secrets.json')) as f:
      secrets = json.loads(f.read())
  
  
  def get_secret(setting, secrets=secrets):
      try:
          return secrets[setting]
      except KeyError:
          error_msg = '"{0}" environment variable missing'.format(setting)
          raise ImproperlyConfigured(error_msg)
  
  ADMINS = (
      (get_secret('ADMIN_NAME'), get_secret('ADMIN_EMAIL')),
  )
  
  SECRET_KEY = get_secret('SECRET_KEY')
  DEBUG = False
  ALLOWED_HOSTS = ['.ahernp.com']
  
  INSTALLED_APPS = [
      'django.contrib.admin',
      'django.contrib.auth',
      'django.contrib.contenttypes',
      'django.contrib.sessions',
      'django.contrib.messages',
      'django.contrib.staticfiles',
      'pages.apps.PagesConfig',
      'blog.apps.BlogConfig',
      'core.apps.CoreConfig',
      'feedreader.apps.FeedreaderConfig',
  ]
  
  MIDDLEWARE_CLASSES = [
      'django.middleware.security.SecurityMiddleware',
      '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',
  ]
  
  ROOT_URLCONF = 'ad.urls'
  
  TEMPLATES = [
      {
          'BACKEND': 'django.template.backends.django.DjangoTemplates',
          'DIRS': [os.path.normpath(os.path.join(BASE_DIR, 'templates'))],
          '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 = 'ad.wsgi.application'
  
  DATABASES = {
      'default': {
          'ENGINE': 'django.db.backends.postgresql_psycopg2',
          'NAME': get_secret('DATABASE_NAME'),
          'USER': get_secret('DATABASE_USER'),
          'PASSWORD': get_secret('DATABASE_PASSWORD'),
          'HOST': get_secret('DATABASE_HOST'),
          'PORT': get_secret('DATABASE_PORT'),
      }
  }
  
  AUTH_PASSWORD_VALIDATORS = [
      {'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator'},
      {'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator'},
      {'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator'},
      {'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator'},
  ]
  
  LANGUAGE_CODE = 'en-uk'
  TIME_ZONE = 'Europe/London'
  USE_I18N = True
  USE_L10N = True
  USE_TZ = True
  
  STATIC_ROOT = os.path.normpath(os.path.join(BASE_DIR, 'static'))
  STATIC_URL = '/static/'
  STATICFILES_DIRS = (
      os.path.normpath(os.path.join(BASE_DIR, 'site_assets')),
  )
  
  MEDIA_ROOT = os.path.normpath(os.path.join(BASE_DIR, 'media'))
  MEDIA_URL = '/media/'
  
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'filters': {
          'require_debug_false': {
              '()': 'django.utils.log.RequireDebugFalse'
          }
      },
      'handlers': {
          'mail_admins': {
              'level': 'ERROR',
              'filters': ['require_debug_false'],
              'class': 'django.utils.log.AdminEmailHandler'
          },
          'db_log': {
              'level': 'INFO',
              # Reference to handler in log.py below
              'class': 'core.log.DbLogHandler',
          }
      },
      'loggers': {
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': True,
          },
          'core': {
              'handlers': ['db_log', ],
              'level': 'INFO',
              'propagate': True,
          },
          'feedreader': {
              'handlers': ['db_log', ],
              'level': 'INFO',
              'propagate': True,
          }
      }
  }
  
  SITE_NAME = 'ahernp.com'
  BLOG_ROOT_SLUG = 'blog'
  
  # Dashboard
  LOG_ENTRIES_TO_SHOW = 10
  
  # Feedreader
  MAX_ENTRIES_SAVED = 100
  MAX_ENTRIES_SHOWN = 100
  MAX_DAYS_SHOWN = 1
  