RadarParlamentar-MES2017-1/radar

View on GitHub
radar_parlamentar/settings/production.py.template

Summary

Maintainability
Test Coverage
from defaults import *
import os

print('Starting PRODUCTION environment ...')

DEBUG = False
TEMPLATE_DEBUG = DEBUG

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.postgresql_psycopg2', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
        'NAME': 'radar',                      # Or path to database file if using sqlite3.
        'USER': 'root',                       # Not used with sqlite3.
        'PASSWORD': 'coloque_a_senha_aqui',   # Not used with sqlite3.
        'HOST': 'localhost',                           # Set to empty string for localhost. Not used with sqlite3.
        'PORT': '',                           # Set to empty string for default. Not used with sqlite3.
    }
}


MIDDLEWARE_CLASSES = [
    'radar_parlamentar.middleware.SmartUpdateCacheMiddleware', 
    'django.middleware.common.CommonMiddleware',
    'django.middleware.cache.FetchFromCacheMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'radar_parlamentar.middleware.ConsoleExceptionMiddleware',
    'radar_parlamentar.middleware.ExceptionLoggingMiddleware'
    # Uncomment the next line for simple clickjacking protection:
    # 'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

CACHE_MIDDLEWARE_SECONDS = 10000000
CACHE_MIDDLEWARE_KEY_PREFIX = 'site_cache'


CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/tmp/django_cache',
    }
}

here = os.path.abspath(os.path.dirname(__file__))
TEMPLATE_DIRS = ( os.path.join(here, os.pardir, 'radar_parlamentar/templates/') )

LOGGING['handlers']['file']['filename'] = '/var/log/radar/radar.log'