"""Production settings and globals."""


from os import environ

from base import *

# Normally you should not import ANYTHING from Django directly
# into your settings, but ImproperlyConfigured is an exception.
from django.core.exceptions import ImproperlyConfigured


def get_env_setting(setting):
	""" Get the environment setting or return exception """
	try:
		return environ[setting]
	except KeyError:
		error_msg = "Set the %s env variable" % setting
		raise ImproperlyConfigured(error_msg)

########## EMAIL CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host
EMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password
EMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user
EMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 'your_email@example.com')

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port
EMAIL_PORT = environ.get('EMAIL_PORT', 587)

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix
EMAIL_SUBJECT_PREFIX = '[%s] ' % SITE_NAME

# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls
EMAIL_USE_TLS = True

# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email
SERVER_EMAIL = EMAIL_HOST_USER
########## END EMAIL CONFIGURATION


########## DATABASE CONFIGURATION
DATABASES = {}
########## END DATABASE CONFIGURATION


########## CACHE CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches
CACHES = {}
########## END CACHE CONFIGURATION





########## SECRET CONFIGURATION
# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key
SECRET_KEY = get_env_setting('SECRET_KEY')
########## END SECRET CONFIGURATION

@@ -37,1942 +37,237 @@
 %22%22%0A%0A
-%0Afrom os import environ%0A%0Afrom base import *%0A%0A# Normally you should not import ANYTHING from Django directly%0A# into your settings, but ImproperlyConfigured is an exception.%0Afrom django.core.exceptions import ImproperlyConfigured%0A%0A%0Adef get_env_setting(setting):%0A%09%22%22%22 Get the environment setting or return exception %22%22%22%0A%09try:%0A%09%09return environ%5Bsetting%5D%0A%09except KeyError:%0A%09%09error_msg = %22Set the %25s env variable%22 %25 setting%0A%09%09raise ImproperlyConfigured(error_msg)%0A%0A########## EMAIL CONFIGURATION%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-backend%0AEMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host%0AEMAIL_HOST = environ.get('EMAIL_HOST', 'smtp.gmail.com')%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-password%0AEMAIL_HOST_PASSWORD = environ.get('EMAIL_HOST_PASSWORD', '')%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-host-user%0AEMAIL_HOST_USER = environ.get('EMAIL_HOST_USER', 'your_email@example.com')%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-port%0AEMAIL_PORT = environ.get('EMAIL_PORT', 587)%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-subject-prefix%0AEMAIL_SUBJECT_PREFIX = '%5B%25s%5D ' %25 SITE_NAME%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#email-use-tls%0AEMAIL_USE_TLS = True%0A%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#server-email%0ASERVER_EMAIL = EMAIL_HOST_USER%0A########## END EMAIL CONFIGURATION%0A%0A%0A########## DATABASE CONFIGURATION%0ADATABASES = %7B%7D%0A########## END DATABASE CONFIGURATION%0A%0A%0A########## CACHE CONFIGURATION%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#caches%0ACACHES = %7B%7D%0A########## END CACHE CONFIGURATION%0A%0A%0A%0A%0A%0A########## SECRET CONFIGURATION%0A# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key%0ASECRET_KEY = get_env_setting('SECRET_KEY')%0A########## END SECRET CONFIGURATION
+from base import *%0A%0ADATABASES = %7B%0A    'default': %7B%0A        'ENGINE': 'django.db.backends.postgresql_psycopg2',%0A        'NAME': 'hyrodactil',%0A        'USER': '',%0A        'PASSWORD': '',%0A        'HOST': '',%0A        'PORT': '',%0A    %7D%0A%7D
 %0A

Configure production settings