<commit_before># Universal Subtitles, universalsubtitles.org
# 
# Copyright (C) 2010 Participatory Culture Foundation
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see 
# http://www.gnu.org/licenses/agpl-3.0.html.

from datetime import timedelta
from settings import *
from server_local_settings import *


DEBUG = False

ADMINS = (
    ('<NAME>', '<EMAIL>'),
    ('universalsubtitles-errors', '<EMAIL>')
)

if INSTALLATION == DEV:
    SITE_ID = 13
    SITE_NAME = 'unisubsdev'
    REDIS_DB = "3"
    EMAIL_SUBJECT_PREFIX = '[usubs-dev]'
    SENTRY_TESTING = True
    SOLR_ROOT = '/usr/share/'
    BROKER_BACKEND = 'amqplib'
    BROKER_HOST = "localhost"
    BROKER_PORT = 5672
    BROKER_USER = "unisub"
    BROKER_PASSWORD = "<PASSWORD>"
    BROKER_VHOST = "unisub"
    CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == STAGING:
    SITE_ID = 14
    SITE_NAME = 'unisubsstaging'
    REDIS_DB = "2"
    AWS_QUEUE_PREFIX = 'STAGING'
    SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
    EMAIL_SUBJECT_PREFIX = '[usubs-staging]'
    CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == PRODUCTION:
    SEARCH_INDEXING_HOUR_STARTS = 8
    SITE_ID = 8
    SITE_NAME = 'unisubs'
    REDIS_DB = "1"
    AWS_QUEUE_PREFIX = 'PRODUCTION'
    SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
    EMAIL_SUBJECT_PREFIX = '[usubs-production]'
    EMAIL_BCC_LIST.append('<EMAIL>')
    COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    ADMINS = (
      ('universalsubtitles-errors', '<EMAIL>'),
    )
    # only send actual email on the production server
    EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
    
if INSTALLATION == STAGING or INSTALLATION == PRODUCTION:
    uslogging_db = {
        'uslogging': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': SENTRY_DATABASE_NAME,
            'USER': SENTRY_DATABASE_USER,
            'PASSWORD': SENTRY_DATABASE_PASSWORD,
            'HOST': SENTRY_DATABASE_HOST,
            'PORT': '3306'
            }
        }
    USLOGGING_DATABASE = 'uslogging'
    DATABASE_ROUTERS = ['routers.UnisubsRouter']
    AWS_STORAGE_BUCKET_NAME = DEFAULT_BUCKET
    COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    COMPRESS_URL = STATIC_URL
    SOLR_ROOT = '/usr/share/'
else:
    uslogging_db = {}

CELERYD_LOG_LEVEL = 'INFO'
CELERY_REDIRECT_STDOUTS = True
CELERY_REDIRECT_STDOUTS_LEVEL = 'INFO'

RECAPTCHA_PUBLIC = '6LftU8USAAAAADia-hmK1RTJyqXjFf_T5QzqLE9o'

IGNORE_REDIS = True

ALARM_EMAIL = FEEDBACK_EMAILS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': DATABASE_NAME,
        'USER': DATABASE_USER,
        'PASSWORD': <PASSWORD>,
        'HOST': DATABASE_HOST,
        'PORT': '3306'
        }
    }

DATABASES.update(uslogging_db)

USE_AMAZON_S3 = AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and DEFAULT_BUCKET

try:
    from settings_local import *
except ImportError:
    pass

if USE_AMAZON_S3:
    AWS_BUCKET_NAME = AWS_STORAGE_BUCKET_NAME


COMPRESS_MEDIA = not DEBUG
STATIC_URL_BASE = STATIC_URL
if COMPRESS_MEDIA:
    STATIC_URL += "%s/%s/" % (COMPRESS_OUTPUT_DIRNAME, LAST_COMMIT_GUID.split("/")[1])

<commit_msg>Added CACHE_PREFIX and CACHE_TIMEOUT to remove warnings for keydcache<commit_after># Universal Subtitles, universalsubtitles.org
# 
# Copyright (C) 2010 Participatory Culture Foundation
# 
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
# 
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see 
# http://www.gnu.org/licenses/agpl-3.0.html.

from datetime import timedelta
from settings import *
from server_local_settings import *


DEBUG = False

ADMINS = (
    ('<NAME>', '<EMAIL>'),
    ('universalsubtitles-errors', '<EMAIL>')
)

if INSTALLATION == DEV:
    SITE_ID = 13
    SITE_NAME = 'unisubsdev'
    REDIS_DB = "3"
    EMAIL_SUBJECT_PREFIX = '[usubs-dev]'
    SENTRY_TESTING = True
    SOLR_ROOT = '/usr/share/'
    BROKER_BACKEND = 'amqplib'
    BROKER_HOST = "localhost"
    BROKER_PORT = 5672
    BROKER_USER = "unisub"
    BROKER_PASSWORD = "<PASSWORD>"
    BROKER_VHOST = "unisub"
    CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == STAGING:
    SITE_ID = 14
    SITE_NAME = 'unisubsstaging'
    REDIS_DB = "2"
    AWS_QUEUE_PREFIX = 'STAGING'
    SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
    EMAIL_SUBJECT_PREFIX = '[usubs-staging]'
    CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == PRODUCTION:
    SEARCH_INDEXING_HOUR_STARTS = 8
    SITE_ID = 8
    SITE_NAME = 'unisubs'
    REDIS_DB = "1"
    AWS_QUEUE_PREFIX = 'PRODUCTION'
    SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
    EMAIL_SUBJECT_PREFIX = '[usubs-production]'
    EMAIL_BCC_LIST.append('<EMAIL>')
    COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    ADMINS = (
      ('universalsubtitles-errors', '<EMAIL>'),
    )
    # only send actual email on the production server
    EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
    
if INSTALLATION == STAGING or INSTALLATION == PRODUCTION:
    uslogging_db = {
        'uslogging': {
            'ENGINE': 'django.db.backends.mysql',
            'NAME': SENTRY_DATABASE_NAME,
            'USER': SENTRY_DATABASE_USER,
            'PASSWORD': SENTRY_DATABASE_PASSWORD,
            'HOST': SENTRY_DATABASE_HOST,
            'PORT': '3306'
            }
        }
    USLOGGING_DATABASE = 'uslogging'
    DATABASE_ROUTERS = ['routers.UnisubsRouter']
    AWS_STORAGE_BUCKET_NAME = DEFAULT_BUCKET
    COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
    COMPRESS_URL = STATIC_URL
    SOLR_ROOT = '/usr/share/'
else:
    uslogging_db = {}

CELERYD_LOG_LEVEL = 'INFO'
CELERY_REDIRECT_STDOUTS = True
CELERY_REDIRECT_STDOUTS_LEVEL = 'INFO'

RECAPTCHA_PUBLIC = '6LftU8USAAAAADia-hmK1RTJyqXjFf_T5QzqLE9o'

IGNORE_REDIS = True

ALARM_EMAIL = FEEDBACK_EMAILS

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
        'NAME': DATABASE_NAME,
        'USER': DATABASE_USER,
        'PASSWORD': DATABASE_PASSWORD,
        'HOST': DATABASE_HOST,
        'PORT': '3306'
        }
    }

DATABASES.update(uslogging_db)

USE_AMAZON_S3 = AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY and DEFAULT_BUCKET

try:
    from settings_local import *
except ImportError:
    pass

if USE_AMAZON_S3:
    AWS_BUCKET_NAME = AWS_STORAGE_BUCKET_NAME


COMPRESS_MEDIA = not DEBUG
STATIC_URL_BASE = STATIC_URL
if COMPRESS_MEDIA:
    STATIC_URL += "%s/%s/" % (COMPRESS_OUTPUT_DIRNAME, LAST_COMMIT_GUID.split("/")[1])

#  the keyd cache apps need this:
CACHE_TIMEOUT  = 60
CACHE_PREFIX  = "unisubscache"

{'fraction_non_alphanumeric': 0.09564320701211652, 'fraction_numerical': 0.01108533127094612, 'mean_word_length': 3.577581120943953, 'pattern_counts': {'":': 0, '<': 16, '<?xml version=': 0, '>': 16, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '6051253', 'n_tokens_mistral': 2934, 'n_tokens_neox': 2830, 'n_words': 612}