<commit_before>from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

TEMPLATE_DEBUG = False

ALLOWED_HOSTS = ['*']

STATIC_ROOT = normpath(join(SITE_ROOT, 'http_static'))

LOGGING = {
    'version': 1,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(module)s %(message)s'
        }
    },
    'handlers': {
        'logfile': {
            'class': 'logging.handlers.WatchedFileHandler',
            'filename': '/var/opt/tlt/logs/ab_testing_tool.log',
            'formatter': 'verbose',
            'level': 'DEBUG',
        },
     },
    'loggers': {
        'django.request': {
            'handlers':['console'],
            'propagate': True,
            'level':'DEBUG',
        },
        'django_auth_lti': {
            'handlers': ['console'],
            'propagate': True,
            'level': 'DEBUG'
        },
        'ab_tool': {
            'handlers': ['console'],
            'propagate': True,
            'level': 'DEBUG',
        },
        'error_middleware': {
            'handlers': ['console'],
            'propagate': True,
            'level': 'DEBUG',
        }
    },
}<commit_msg>Add file logging and redis cache for qa environment.<commit_after>from .base import *

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = False

TEMPLATE_DEBUG = False

ALLOWED_HOSTS = ['*']

STATIC_ROOT = normpath(join(SITE_ROOT, 'http_static'))

INSTALLED_APPS += (
    'gunicorn',
)

LOGGING = {
    'version': 1,
    'formatters': {
        'verbose': {
            'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
        },
        'simple': {
            'format': '%(levelname)s %(module)s %(message)s'
        }
    },
    'handlers': {
        'logfile': {
            'class': 'logging.handlers.WatchedFileHandler',
            'filename': '/var/opt/tlt/logs/ab_testing_tool.log',
            'formatter': 'verbose',
            'level': 'DEBUG',
        },
        'console': {
            'level': 'DEBUG',
            'class': 'logging.StreamHandler',
            'formatter': 'simple',
        },
    },
    'loggers': {
        'django.request': {
            'handlers':['console', 'logfile'],
            'propagate': True,
            'level':'DEBUG',
        },
        'django_auth_lti': {
            'handlers': ['console', 'logfile'],
            'propagate': True,
            'level': 'DEBUG'
        },
        'ab_tool': {
            'handlers': ['console', 'logfile'],
            'propagate': True,
            'level': 'DEBUG',
        },
        'error_middleware': {
            'handlers': ['console', 'logfile'],
            'propagate': True,
            'level': 'DEBUG',
        }
    },
}

CACHES = {
    'default': {
        'BACKEND': 'redis_cache.RedisCache',
        'LOCATION': 'django-qa-cache.kc9kh3.0001.use1.cache.amazonaws.com:6379',
        'OPTIONS': {
            'PARSER_CLASS': 'redis.connection.HiredisParser'
        },
    },
}

SESSION_ENGINE = 'redis_sessions.session'
SESSION_REDIS_HOST = 'django-qa-cache.kc9kh3.0001.use1.cache.amazonaws.com'
SESSION_REDIS_PORT = 6379

SESSION_COOKIE_SECURE = True
{'fraction_non_alphanumeric': 0.17005988023952096, 'fraction_numerical': 0.00718562874251497, 'mean_word_length': 1.9307017543859648, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7563739', 'n_tokens_mistral': 1106, 'n_tokens_neox': 1080, 'n_words': 188}