# Path: avalonstar/settings/base.py
# class Base(Configuration):
#     # Path configuration.
#     # --------------------------------------------------------------------------
#     DJANGO_ROOT = dirname(dirname(abspath(__file__)))
#     SITE_ROOT = dirname(DJANGO_ROOT)
#     SITE_NAME = basename(DJANGO_ROOT)
# 
#     # Installed Applications.
#     # --------------------------------------------------------------------------
#     DJANGO = [
#         'django.contrib.auth',
#         'django.contrib.contenttypes',
#         'django.contrib.humanize',
#         'django.contrib.messages',
#         'django.contrib.sessions',
#         'django.contrib.staticfiles',
#     ]
#     COMPONENTS = [
#         'apps.broadcasts',
#         'apps.core',
#         'apps.games',
#         'apps.live',
#         'apps.quotes',
#         'apps.subscribers',
#     ]
#     PLUGINS = [
#         'corsheaders'
#     ]
#     ADMINISTRATION = [
#         'grappelli',
#         'django.contrib.admin',
#     ]
#     INSTALLED_APPS = DJANGO + COMPONENTS + PLUGINS + ADMINISTRATION
# 
#     # Middleware Configuration.
#     # --------------------------------------------------------------------------
#     MIDDLEWARE_CLASSES = (
#         'django.contrib.sessions.middleware.SessionMiddleware',
#         'corsheaders.middleware.CorsMiddleware',
#         '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',
#     )
# 
#     # Debug Settings.
#     # --------------------------------------------------------------------------
#     DEBUG = values.BooleanValue(True)
# 
#     # Secret Key Configuration.
#     # --------------------------------------------------------------------------
#     SECRET_KEY = '+7wd8f!r%3@p)&%=td=63vi@d*i9_#2ln8ge+x&-4%$j$xrpo^'
# 
#     # Database Configuration.
#     # --------------------------------------------------------------------------
#     DATABASES = postgresify()
# 
#     # Internationalization.
#     # --------------------------------------------------------------------------
#     LANGUAGE_CODE = 'en-us'
#     TIME_ZONE = 'America/Los_Angeles'
#     USE_I18N = True
#     USE_L10N = True
#     USE_TZ = True
# 
#     # Template Configuration.
#     # --------------------------------------------------------------------------
#     TEMPLATES = [
#         {
#             'BACKEND': 'django.template.backends.django.DjangoTemplates',
#             'DIRS': [normpath(join(SITE_ROOT, 'templates'))],
#             'APP_DIRS': True,
#             'OPTIONS': {
#                 'context_processors': [
#                     'django.contrib.auth.context_processors.auth',
#                     'django.template.context_processors.debug',
#                     'django.template.context_processors.i18n',
#                     'django.template.context_processors.media',
#                     'django.template.context_processors.static',
#                     'django.template.context_processors.request',
#                     'django.template.context_processors.tz',
#                     'django.contrib.messages.context_processors.messages',
#                 ],
#             },
#         },
#     ]
# 
#     # Static File Configuration.
#     # --------------------------------------------------------------------------
#     STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
#     STATIC_ROOT = 'staticfiles'
#     STATIC_URL = '/static/'
#     STATICFILES_DIRS = [normpath(join(SITE_ROOT, 'static'))]
#     STATICFILES_FINDERS = (
#         'django.contrib.staticfiles.finders.FileSystemFinder',
#         'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#     )
# 
#     # Media Configuration.
#     # --------------------------------------------------------------------------
#     MEDIA_ROOT = 'media'
#     MEDIA_URL = '/media/'
# 
#     # URL Configuration.
#     # --------------------------------------------------------------------------
#     ROOT_URLCONF = '%s.urls' % SITE_NAME
#     WSGI_APPLICATION = 'avalonstar.wsgi.application'
# 
#     # django-rest-framework.
#     # --------------------------------------------------------------------------
#     INSTALLED_APPS += [
#         'rest_framework',
#         'rest_framework.authtoken'
#     ]
#     REST_FRAMEWORK = {
#         'DEFAULT_AUTHENTICATION_CLASSES': (
#             'rest_framework.authentication.BasicAuthentication',
#             'rest_framework.authentication.SessionAuthentication',
#             'rest_framework.authentication.TokenAuthentication'
#         )
#     }


import os
import sys
from configurations import values
from postgresify import postgresify
from .base import Base as Settings
    AWS_EXPIRY = 60 * 60 * 24 * 7
    AWS_HEADERS = {'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY)}

    # ...
    CDN_DOMAIN = 'http://avalonstar-tv.s3.amazonaws.com'
    MEDIA_URL = '%s/' % (CDN_DOMAIN)

    # Database Configuration.
    # --------------------------------------------------------------------------
    DATABASES = postgresify()
    if 'default' in DATABASES:  # pragma: no branch
        DATABASES['default']['CONN_MAX_AGE'] = 600

    # Logging Configuration.
    # --------------------------------------------------------------------------
    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'filters': {
            'require_debug_false': {
                '()': 'django.utils.log.RequireDebugFalse'
            }
        },
        'formatters': {
            'verbose': {
                'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
                'datefmt': '%d/%b/%Y %H:%M:%S'
            },
            'simple': {
                'format': '%(levelname)s %(message)s'

# Path: avalonstar/settings/base.py
# class Base(Configuration):
#     # Path configuration.
#     # --------------------------------------------------------------------------
#     DJANGO_ROOT = dirname(dirname(abspath(__file__)))
#     SITE_ROOT = dirname(DJANGO_ROOT)
#     SITE_NAME = basename(DJANGO_ROOT)
# 
#     # Installed Applications.
#     # --------------------------------------------------------------------------
#     DJANGO = [
#         'django.contrib.auth',
#         'django.contrib.contenttypes',
#         'django.contrib.humanize',
#         'django.contrib.messages',
#         'django.contrib.sessions',
#         'django.contrib.staticfiles',
#     ]
#     COMPONENTS = [
#         'apps.broadcasts',
#         'apps.core',
#         'apps.games',
#         'apps.live',
#         'apps.quotes',
#         'apps.subscribers',
#     ]
#     PLUGINS = [
#         'corsheaders'
#     ]
#     ADMINISTRATION = [
#         'grappelli',
#         'django.contrib.admin',
#     ]
#     INSTALLED_APPS = DJANGO + COMPONENTS + PLUGINS + ADMINISTRATION
# 
#     # Middleware Configuration.
#     # --------------------------------------------------------------------------
#     MIDDLEWARE_CLASSES = (
#         'django.contrib.sessions.middleware.SessionMiddleware',
#         'corsheaders.middleware.CorsMiddleware',
#         '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',
#     )
# 
#     # Debug Settings.
#     # --------------------------------------------------------------------------
#     DEBUG = values.BooleanValue(True)
# 
#     # Secret Key Configuration.
#     # --------------------------------------------------------------------------
#     SECRET_KEY = '+7wd8f!r%3@p)&%=td=63vi@d*i9_#2ln8ge+x&-4%$j$xrpo^'
# 
#     # Database Configuration.
#     # --------------------------------------------------------------------------
#     DATABASES = postgresify()
# 
#     # Internationalization.
#     # --------------------------------------------------------------------------
#     LANGUAGE_CODE = 'en-us'
#     TIME_ZONE = 'America/Los_Angeles'
#     USE_I18N = True
#     USE_L10N = True
#     USE_TZ = True
# 
#     # Template Configuration.
#     # --------------------------------------------------------------------------
#     TEMPLATES = [
#         {
#             'BACKEND': 'django.template.backends.django.DjangoTemplates',
#             'DIRS': [normpath(join(SITE_ROOT, 'templates'))],
#             'APP_DIRS': True,
#             'OPTIONS': {
#                 'context_processors': [
#                     'django.contrib.auth.context_processors.auth',
#                     'django.template.context_processors.debug',
#                     'django.template.context_processors.i18n',
#                     'django.template.context_processors.media',
#                     'django.template.context_processors.static',
#                     'django.template.context_processors.request',
#                     'django.template.context_processors.tz',
#                     'django.contrib.messages.context_processors.messages',
#                 ],
#             },
#         },
#     ]
# 
#     # Static File Configuration.
#     # --------------------------------------------------------------------------
#     STATICFILES_STORAGE = 'whitenoise.django.GzipManifestStaticFilesStorage'
#     STATIC_ROOT = 'staticfiles'
#     STATIC_URL = '/static/'
#     STATICFILES_DIRS = [normpath(join(SITE_ROOT, 'static'))]
#     STATICFILES_FINDERS = (
#         'django.contrib.staticfiles.finders.FileSystemFinder',
#         'django.contrib.staticfiles.finders.AppDirectoriesFinder',
#     )
# 
#     # Media Configuration.
#     # --------------------------------------------------------------------------
#     MEDIA_ROOT = 'media'
#     MEDIA_URL = '/media/'
# 
#     # URL Configuration.
#     # --------------------------------------------------------------------------
#     ROOT_URLCONF = '%s.urls' % SITE_NAME
#     WSGI_APPLICATION = 'avalonstar.wsgi.application'
# 
#     # django-rest-framework.
#     # --------------------------------------------------------------------------
#     INSTALLED_APPS += [
#         'rest_framework',
#         'rest_framework.authtoken'
#     ]
#     REST_FRAMEWORK = {
#         'DEFAULT_AUTHENTICATION_CLASSES': (
#             'rest_framework.authentication.BasicAuthentication',
#             'rest_framework.authentication.SessionAuthentication',
#             'rest_framework.authentication.TokenAuthentication'
#         )
#     }


# Path: avalonstar/settings/production.py
import os
import sys
from configurations import values
from postgresify import postgresify
from .base import Base as Settings

    AWS_EXPIRY = 60 * 60 * 24 * 7
    AWS_HEADERS = {'Cache-Control': 'max-age=%d, s-maxage=%d, must-revalidate' % (AWS_EXPIRY, AWS_EXPIRY)}

    # ...
    CDN_DOMAIN = 'http://avalonstar-tv.s3.amazonaws.com'
    MEDIA_URL = '%s/' % (CDN_DOMAIN)

    # Database Configuration.
    # --------------------------------------------------------------------------
    DATABASES = postgresify()
    if 'default' in DATABASES:  # pragma: no branch
        DATABASES['default']['CONN_MAX_AGE'] = 600

    # Logging Configuration.
    # --------------------------------------------------------------------------
    LOGGING = {
        'version': 1,
        'disable_existing_loggers': False,
        'filters': {
            'require_debug_false': {
                '()': 'django.utils.log.RequireDebugFalse'
            }
        },
        'formatters': {
            'verbose': {
                'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s',
                'datefmt': '%d/%b/%Y %H:%M:%S'
            },
            'simple': {
                'format': '%(levelname)s %(message)s'

            },