forked from AustralianDisabilityLimited/unisubs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
unisubs_settings.py
122 lines (103 loc) · 3.51 KB
/
unisubs_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Amara, universalsubtitles.org
#
# Copyright (C) 2013 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 = (
('Craig Zheng', '[email protected]'),
('universalsubtitles-errors', '[email protected]')
)
if INSTALLATION == DEV:
ADMINS = (
('Evan', '[email protected]'),
)
SITE_ID = 16
SITE_NAME = 'unisubsdev'
REDIS_DB = "3"
EMAIL_SUBJECT_PREFIX = '[usubs-dev]'
SENTRY_TESTING = True
SOLR_ROOT = '/usr/share/'
CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == STAGING:
SITE_ID = 17
SITE_NAME = 'unisubsstaging'
REDIS_DB = "2"
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
EMAIL_SUBJECT_PREFIX = '[usubs-staging]'
CELERY_TASK_RESULT_EXPIRES = timedelta(days=7)
elif INSTALLATION == PRODUCTION:
SITE_ID = 18
SITE_NAME = 'unisubs'
REDIS_DB = "1"
SESSION_ENGINE = 'django.contrib.sessions.backends.cached_db'
EMAIL_SUBJECT_PREFIX = '[usubs-production]'
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
ADMINS = (
('universalsubtitles-errors', '[email protected]'),
)
# only send actual email on the production server
EMAIL_BACKEND = "django.core.mail.backends.smtp.EmailBackend"
elif INSTALLATION == DEMO:
DEBUG = True
REDIS_DB = "4"
SENTRY_TESTING = True
elif INSTALLATION == LOCAL:
SITE_ID = 14
SITE_NAME = 'unisubsstaging'
ADMINS = (
('Evan', '[email protected]'),
)
if INSTALLATION == STAGING or INSTALLATION == PRODUCTION or INSTALLATION == LOCAL:
DATABASE_ROUTERS = ['routers.UnisubsRouter']
AWS_STORAGE_BUCKET_NAME = DEFAULT_BUCKET
COMPRESS_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
COMPRESS_URL = STATIC_URL
SOLR_ROOT = '/usr/share/'
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])
ADMIN_MEDIA_PREFIX = "%sadmin/" % STATIC_URL_BASE
# the keyd cache apps need this:
CACHE_TIMEOUT = 60
CACHE_PREFIX = "unisubscache"