from .base import *
import os


DEBUG = False
TEMPLATE_DEBUG = DEBUG

INSTALLED_APPS += ('raven.contrib.django.raven_compat', )

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2',
        'NAME': os.environ['POSTGRES_DB'],
        'USER': os.environ['POSTGRES_USER'],
        'PASSWORD': os.environ.get('POSTGRES_PASS', ''),
        'HOST': os.environ.get('POSTGRES_HOST', ''),
        'PORT': os.environ.get('POSTGRES_PORT', ''),
        'OPTIONS': {
            'sslmode': 'require',
        },
    }
}

BROKER_TRANSPORT_OPTIONS = {'region': 'eu-west-1',
                            'queue_name_prefix': 'production-',
                            'polling_interval': 1}

ALLOWED_HOSTS = ["www.makeaplea.justice.gov.uk", ]

# Enable CachedStaticFilesStorage for cache-busting assets
STATICFILES_STORAGE = 'django.contrib.staticfiles.storage.CachedStaticFilesStorage'

SESSION_COOKIE_SECURE = True

# Emails
SMTP_ROUTES["GSI"]["HOST"] = os.environ.get('GSI_EMAIL_HOST', '')
SMTP_ROUTES["GSI"]["PORT"] = int(os.environ.get('GSI_EMAIL_PORT', '25'))

EMAIL_HOST = os.environ.get('EMAIL_HOST', 'email-smtp.eu-west-1.amazonaws.com')
EMAIL_PORT = int(os.environ.get('EMAIL_PORT', '587'))
EMAIL_HOST_USER = os.environ['EMAIL_HOST_USERNAME']
EMAIL_HOST_PASSWORD = os.environ['EMAIL_HOST_PASSWORD']
EMAIL_USE_TLS = True

PLEA_EMAIL_FROM = os.environ['PLEA_EMAIL_FROM']
PLEA_EMAIL_TO = [os.environ['PLEA_EMAIL_TO'], ]
PLP_EMAIL_TO = [os.environ["PLP_EMAIL_TO"], ]

FEEDBACK_EMAIL_TO = [os.environ["FEEDBACK_EMAIL_TO"], ]
FEEDBACK_EMAIL_FROM = os.environ["FEEDBACK_EMAIL_FROM"]

STORE_USER_DATA = True
@@ -67,67 +67,8 @@
 UG%0A%0A
-INSTALLED_APPS += ('raven.contrib.django.raven_compat', )%0A%0A
 DATA
@@ -647,16 +647,75 @@
 l': 1%7D%0A%0A
+INSTALLED_APPS += ('raven.contrib.django.raven_compat', )%0A%0A
 ALLOWED_
@@ -902,16 +902,16 @@
 orage'%0A%0A
+
 SESSION_
@@ -936,677 +936,8 @@
 ue%0A%0A
-# Emails%0ASMTP_ROUTES%5B%22GSI%22%5D%5B%22HOST%22%5D = os.environ.get('GSI_EMAIL_HOST', '')%0ASMTP_ROUTES%5B%22GSI%22%5D%5B%22PORT%22%5D = int(os.environ.get('GSI_EMAIL_PORT', '25'))%0A%0AEMAIL_HOST = os.environ.get('EMAIL_HOST', 'email-smtp.eu-west-1.amazonaws.com')%0AEMAIL_PORT = int(os.environ.get('EMAIL_PORT', '587'))%0AEMAIL_HOST_USER = os.environ%5B'EMAIL_HOST_USERNAME'%5D%0AEMAIL_HOST_PASSWORD = os.environ%5B'EMAIL_HOST_PASSWORD'%5D%0AEMAIL_USE_TLS = True%0A%0APLEA_EMAIL_FROM = os.environ%5B'PLEA_EMAIL_FROM'%5D%0APLEA_EMAIL_TO = %5Bos.environ%5B'PLEA_EMAIL_TO'%5D, %5D%0APLP_EMAIL_TO = %5Bos.environ%5B%22PLP_EMAIL_TO%22%5D, %5D%0A%0AFEEDBACK_EMAIL_TO = %5Bos.environ%5B%22FEEDBACK_EMAIL_TO%22%5D, %5D%0AFEEDBACK_EMAIL_FROM = os.environ%5B%22FEEDBACK_EMAIL_FROM%22%5D%0A%0A
 STOR

Fix production settings for new email routes