"""
Django settings for {{ project_name }} project.

For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

from os import environ
from os.path import dirname, join
import dj_database_url


# Becasue our settings are inside another directory, go out one more level
# Build paths inside the project like this: join(BASE_DIR, ...)
BASE_DIR = dirname(dirname(dirname(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/

# Keep your secret key in an environment variable to help keep it from falling
# into the wrong hands
SECRET_KEY = environ["SECRET_KEY"]

# Default DEBUG to False for security reasons, ok to override in local
DEBUG = False
# For quick debugging in production USE WITH CAUTION
if environ['DEBUG'] == 'True':
    DEBUG = True

TEMPLATE_DEBUG = DEBUG


# Application definition
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
)

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',
)

ROOT_URLCONF = '{{ project_name }}.urls'

WSGI_APPLICATION = '{{ project_name }}.wsgi.application'


# Database
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
DATABASES = {'default': dj_database_url.config(default=environ.get('DATABASE_URL'))}

# Internationalization
# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# By convention, put templates at the base directory level
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
TEMPLATE_DIRS = (
    join(BASE_DIR, 'templates'),
)

# Static files (CSS, JavaScript, Images)
# Great for local development, not terribly well suited for production
# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
STATIC_ROOT = '{{ project_name }}/collectedstatic'
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    join(BASE_DIR, 'static'),
)

"""
Django settings for {{ project_name }} project.

For more information on this file, see
https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/

For the full list of settings and their values, see
https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/
"""

from os import environ
from os.path import dirname, join
import dj_database_url


# Becasue our settings are inside another directory, go out one more level
# Build paths inside the project like this: join(BASE_DIR, ...)
BASE_DIR = dirname(dirname(dirname(__file__)))


# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/

# Keep your secret key in an environment variable to help keep it from falling
# into the wrong hands
SECRET_KEY = environ["SECRET_KEY"]

# Default DEBUG to False for security reasons, ok to override in local
DEBUG = False
# For quick debugging in production USE WITH CAUTION
if environ['DEBUG'] == 'True':
    DEBUG = True

TEMPLATE_DEBUG = DEBUG


# Application definition
INSTALLED_APPS = (
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'south',
)

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',
)

ROOT_URLCONF = '{{ project_name }}.urls'

WSGI_APPLICATION = '{{ project_name }}.wsgi.application'


# Database
# https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases
DATABASES = {'default': dj_database_url.config(default=environ.get('DATABASE_URL'))}

# Internationalization
# https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/
LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True


# By convention, put templates at the base directory level
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs
TEMPLATE_DIRS = (
    join(BASE_DIR, 'templates'),
)

# Static files (CSS, JavaScript, Images)
# Great for local development, not terribly well suited for production
# https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/
STATIC_ROOT = '{{ project_name }}/collectedstatic'
STATIC_URL = '/static/'

STATICFILES_DIRS = (
    join(BASE_DIR, 'static'),
)

Django settings for {{ project_name }} project.  For more information on this file, see https://docs.djangoproject.com/en/{{ docs_version }}/topics/settings/  For the full list of settings and their values, see https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/ # Becasue our settings are inside another directory, go out one more level # Build paths inside the project like this: join(BASE_DIR, ...) # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/{{ docs_version }}/howto/deployment/checklist/ # Keep your secret key in an environment variable to help keep it from falling # into the wrong hands # Default DEBUG to False for security reasons, ok to override in local # For quick debugging in production USE WITH CAUTION # Application definition # Database # https://docs.djangoproject.com/en/{{ docs_version }}/ref/settings/#databases # Internationalization # https://docs.djangoproject.com/en/{{ docs_version }}/topics/i18n/ # By convention, put templates at the base directory level # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-dirs # Static files (CSS, JavaScript, Images) # Great for local development, not terribly well suited for production # https://docs.djangoproject.com/en/{{ docs_version }}/howto/static-files/