text: """Production settings."""
  
  import os
  from .base import *  # NOQA
  
  # Base
  SECRET_KEY = os.getenv('DJANGO_SECRET_KEY')
  ALLOWED_HOSTS = os.getenv('DJANGO_ALLOWED_HOSTS', default=['*'])
  
  # Databases
  DATABASES['default'] = os.getenv('DATABASE_URL')  # NOQA
  DATABASES['default']['ATOMIC_REQUESTS'] = True  # NOQA
  DATABASES['default']['CONN_MAX_AGE'] = os.getenv('CONN_MAX_AGE', default=60)  # NOQA
  
  # Cache
  CACHES = {
      'default': {
          'BACKEND': 'django_redis.cache.RedisCache',
          'LOCATION': os.getenv('REDIS_URL'),
          'OPTIONS': {
              'CLIENT_CLASS': 'django_redis.client.DefaultClient',
              'IGNORE_EXCEPTIONS': True,
          }
      }
  }
  
  # Security
  SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
  SECURE_SSL_REDIRECT = os.getenv('DJANGO_SECURE_SSL_REDIRECT', default=True)
  SESSION_COOKIE_SECURE = True
  CSRF_COOKIE_SECURE = True
  SECURE_HSTS_SECONDS = 60
  SECURE_HSTS_INCLUDE_SUBDOMAINS = os.getenv('DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS', default=True)
  SECURE_HSTS_PRELOAD = os.getenv('DJANGO_SECURE_HSTS_PRELOAD', default=True)
  SECURE_CONTENT_TYPE_NOSNIFF = os.getenv('DJANGO_SECURE_CONTENT_TYPE_NOSNIFF', default=True)
  
  # Storages
  INSTALLED_APPS += ['storages']  # noqa F405
  AWS_STORAGE_BUCKET_NAME = os.getenv('DJANGO_AWS_STORAGE_BUCKET_NAME')
  AWS_QUERYSTRING_AUTH = False
  _AWS_EXPIRY = 60 * 60 * 24 * 7
  AWS_S3_OBJECT_PARAMETERS = {
      'CacheControl': f'max-age={_AWS_EXPIRY}, s-maxage={_AWS_EXPIRY}, must-revalidate',
  }
  
  # Static  files
  STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
  
  # Media
  DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
  MEDIA_URL = f'https://{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com/'
  
  # Templates
  TEMPLATES[0]['OPTIONS']['loaders'] = [  # noqa F405
      (
          'django.template.loaders.cached.Loader',
          [
              'django.template.loaders.filesystem.Loader',
              'django.template.loaders.app_directories.Loader',
          ]
      ),
  ]
  
  # Gunicorn
  INSTALLED_APPS += ['gunicorn']  # noqa F405
  
  # WhiteNoise
  MIDDLEWARE.insert(1, 'whitenoise.middleware.WhiteNoiseMiddleware')  # noqa F405
  
  
  # Logging
  # A sample logging configuration. The only tangible logging
  # performed by this configuration is to send an email to
  # the site admins on every HTTP 500 error when DEBUG=False.
  # See https://docs.djangoproject.com/en/dev/topics/logging for
  # more details on how to customize your logging configuration.
  LOGGING = {
      'version': 1,
      'disable_existing_loggers': False,
      'formatters': {
          'verbose': {
              'format': '{levelname} {asctime} {module} {process:d} {thread:d} {message}',
              'style': '{',
          },
          'simple': {
              'format': '{levelname} {message}',
              'style': '{',
          },
      },
      'filters': {
          'special': {
              '()': 'project.logging.SpecialFilter',
              'foo': 'bar',
          },
          'require_debug_true': {
              '()': 'django.utils.log.RequireDebugTrue',
          },
      },
      'handlers': {
          'console': {
              'level': 'INFO',
              'filters': ['require_debug_true'],
              'class': 'logging.StreamHandler',
              'formatter': 'simple'
          },
          'mail_admins': {
              'level': 'ERROR',
              'class': 'django.utils.log.AdminEmailHandler',
              'filters': ['special']
          }
      },
      'loggers': {
          'django': {
              'handlers': ['console'],
              'propagate': True,
          },
          'django.request': {
              'handlers': ['mail_admins'],
              'level': 'ERROR',
              'propagate': False,
          },
          'myproject.custom': {
              'handlers': ['console', 'mail_admins'],
              'level': 'INFO',
              'filters': ['special']
          }
      }
  }
  