forked from dimagi/commcare-hq
-
Notifications
You must be signed in to change notification settings - Fork 4
/
localsettings.example.py
324 lines (272 loc) · 11.4 KB
/
localsettings.example.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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
from __future__ import absolute_import
from __future__ import unicode_literals
import os
INTERNAL_IPS = ['127.0.0.1']
####### Database config. This assumes Postgres #######
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'commcarehq',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
}
}
SYNCLOGS_SQL_DB_ALIAS = 'default'
USE_PARTITIONED_DATABASE = False
if USE_PARTITIONED_DATABASE:
PARTITION_DATABASE_CONFIG = {
'shards': {
'p1': [0, 1],
'p2': [2, 3]
},
'groups': {
'main': ['default'],
'proxy': ['proxy'],
'form_processing': ['p1', 'p2'],
},
'host_map': {} # allows mapping HOST in DATABASE settings to a different value for plproxy
}
DATABASES.update({
'proxy': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'commcarehq_proxy',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
},
'p1': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'commcarehq_p1',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
},
'p2': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': 'commcarehq_p2',
'USER': 'commcarehq',
'PASSWORD': 'commcarehq',
'HOST': 'localhost',
'PORT': '5432',
'TEST': {
'SERIALIZE': False,
},
},
})
####### Couch Config ######
COUCH_DATABASES = {
'default': {
'COUCH_HTTPS': False,
'COUCH_SERVER_ROOT': '127.0.0.1:5984',
'COUCH_USERNAME': 'commcarehq',
'COUCH_PASSWORD': '',
'COUCH_DATABASE_NAME': 'commcarehq',
},
}
### Public / Pre-login Site information
ENABLE_PRELOGIN_SITE = False
####### # Email setup ########
# email settings: these ones are the custom hq ones
EMAIL_LOGIN = "notifications@example.com"
EMAIL_PASSWORD = "******"
EMAIL_SMTP_HOST = "smtp.gmail.com"
EMAIL_SMTP_PORT = 587
# Print emails to console so there is no danger of spamming, but you can still get registration URLs
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
ADMINS = (('HQ Dev Team', 'commcarehq-dev+www-notifications@example.com'),)
BUG_REPORT_RECIPIENTS = ['commcarehq-support@example.com']
NEW_DOMAIN_RECIPIENTS = ['commcarehq-dev+newdomain@example.com']
EXCHANGE_NOTIFICATION_RECIPIENTS = ['commcarehq-dev+exchange@example.com']
SERVER_EMAIL = 'commcarehq-noreply@example.com' # the physical server emailing - differentiate if needed
DEFAULT_FROM_EMAIL = 'commcarehq-noreply@example.com'
SUPPORT_EMAIL = "commcarehq-support@example.com"
EMAIL_SUBJECT_PREFIX = '[commcarehq] '
SERVER_ENVIRONMENT = 'changeme' #Modify this value if you are deploying multiple environments of HQ to the same machine. Identify the target type of this running environment
####### Log/debug setup ########
DEBUG = True
# log directories must exist and be writeable!
DJANGO_LOG_FILE = "/tmp/commcare-hq.django.log"
LOG_FILE = "/tmp/commcare-hq.log"
SHARED_DRIVE_ROOT = os.path.join(os.path.dirname(os.path.abspath(__file__)), "sharedfiles")
CELERY_PERIODIC_QUEUE = 'celery' # change this to something else if you want a different queue for periodic tasks
CELERY_FLOWER_URL = 'http://127.0.0.1:5555'
####### Less/Django Compressor ########
LESS_DEBUG = True
COMPRESS_ENABLED = False
COMPRESS_OFFLINE = False
####### Bitly ########
BITLY_LOGIN = None # set to None to disable bitly app url shortening (useful offline) set to 'dimagi' if you are using the api key
BITLY_APIKEY = '*******'
####### Jar signing config ########
_ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
# Uncomment below when signing the JAR
# JAR_SIGN = {
# 'key_store': os.path.join(os.path.dirname(os.path.dirname(_ROOT_DIR)), "DimagiKeyStore"),
# 'key_alias': "javarosakey",
# 'store_pass': "*******",
# 'key_pass': "*******",
# }
####### Touchforms config - for CloudCare #######
XFORMS_PLAYER_URL = 'http://127.0.0.1:4444'
# email and password for an admin django user, such as one created with
# ./manage.py make_superuser <email>
TOUCHFORMS_API_USER = 'admin@example.com'
TOUCHFORMS_API_PASSWORD = 'password'
####### Misc / HQ-specific Config ########
DEFAULT_PROTOCOL = "http" # or https
OVERRIDE_LOCATION = "https://www.commcarehq.org"
# Set to something like "192.168.1.5:8000" (with your IP address).
# See corehq/apps/builds/README.md for more information.
BASE_ADDRESS = 'localhost:8000'
# Set your analytics IDs here for GA and pingdom RUM
ANALYTICS_IDS = {
'GOOGLE_ANALYTICS_API_ID': '',
'KISSMETRICS_KEY': '',
'HUBSPOT_API_KEY': '',
'FULLSTORY_ID': '',
}
ANALYTICS_CONFIG = {
"HQ_INSTANCE": '', # e.g. "www", or "india", or "staging"
"DEBUG": DEBUG,
"LOG_LEVEL": "debug", # "warning", "debug", "verbose", or "" for no logging
}
# Green house api key
GREENHOUSE_API_KEY = ''
AXES_LOCK_OUT_AT_FAILURE = False
LUCENE_ENABLED = True
PREVIEWER_RE = r'^.*@dimagi\.com$'
GMAPS_API_KEY = '******'
MAPS_LAYERS = {
'Maps': {
'family': 'mapbox',
'args': {
'apikey': '*****'
}
},
'Satellite': {
'family': 'mapbox',
'args': {
'apikey': '*****'
}
},
}
FORMTRANSLATE_TIMEOUT = 5
LOCAL_APPS = (
# 'django_coverage', # Adds `python manage.py test_coverage` (settings below)
# 'debug_toolbar', # Adds a retractable panel to every page giving profiling & debugging info
# 'devserver', # Adds improved dev server that also prints SQL on the console (for AJAX, etc, when you cannot use debug_toolbar)
# 'django_cpserver', # Another choice for a replacement server
# 'dimagi.utils',
# 'testapps.test_elasticsearch',
# 'testapps.test_pillowtop',
)
LOCAL_MIDDLEWARE = [
# 'debug_toolbar.middleware.DebugToolbarMiddleware',
]
# list of domains to enable ADM reporting on
ADM_ENABLED_PROJECTS = []
# prod settings
SOIL_DEFAULT_CACHE = "redis"
# reports cache
REPORT_CACHE = 'default' # or e.g. 'redis'
redis_cache = {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/0',
'OPTIONS': {
'PICKLE_VERSION': 2, # After PY3 migration: remove
},
}
# example redis cluster setting
redis_cluster_cache = {
'BACKEND': 'django_redis.cache.RedisCache',
'LOCATION': 'redis://127.0.0.1:6379/0',
'OPTIONS': {
'REDIS_CLIENT_CLASS': 'rediscluster.RedisCluster',
'CONNECTION_POOL_CLASS': 'rediscluster.connection.ClusterConnectionPool',
'CONNECTION_POOL_KWARGS': {
'skip_full_coverage_check': True
},
'PICKLE_VERSION': 2, # After PY3 migration: remove
}
}
CACHES = {
'default': redis_cache,
'redis': redis_cache,
}
# on both a local and a distributed environment this should be localhost
ELASTICSEARCH_HOST = 'localhost'
ELASTICSEARCH_PORT = 9200
LOCAL_PILLOWTOPS = {
# 'my_pillows': ['some.pillow.Class', ],
# 'and_more': []
}
####### API throttling #####
CCHQ_API_THROTTLE_REQUESTS = 200 # number of requests allowed per timeframe
# Use a lower value in production. This is set
# to 200 to prevent AssertionError: 429 != 200
# test failures in development environsments.
CCHQ_API_THROTTLE_TIMEFRAME = 10 # seconds
####### django-coverage config ########
COVERAGE_REPORT_HTML_OUTPUT_DIR='coverage-html'
COVERAGE_MODULE_EXCLUDES= ['tests$', 'settings$', 'urls$', 'locale$',
'common.views.test', '^django', 'management', 'migrations',
'^south', '^debug_toolbar']
INTERNAL_DATA = {
"business_unit": [],
"product": ["CommCare", "CommConnect", "CommTrack", "RapidSMS", "Custom"],
"services": [],
"account_types": [],
"initiatives": [],
"contract_type": [],
"area": [
{
"name": "Health",
"sub_areas": ["Maternal, Newborn, & Child Health", "Family Planning", "HIV/AIDS"]
},
{
"name": "Other",
"sub_areas": ["Emergency Response"]
},
],
"country": ["Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antigua & Deps", "Argentina", "Armenia",
"Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus",
"Belgium", "Belize", "Benin", "Bhutan", "Bolivia", "Bosnia Herzegovina", "Botswana", "Brazil",
"Brunei", "Bulgaria", "Burkina", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde",
"Central African Rep", "Chad", "Chile", "China", "Colombia", "Comoros", "Congo",
"Congo {Democratic Rep}", "Costa Rica", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark",
"Djibouti", "Dominica", "Dominican Republic", "East Timor", "Ecuador", "Egypt", "El Salvador",
"Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Fiji", "Finland", "France", "Gabon", "Gambia",
"Georgia", "Germany", "Ghana", "Greece", "Grenada", "Guatemala", "Guinea", "Guinea-Bissau", "Guyana",
"Haiti", "Honduras", "Hungary", "Iceland", "India", "Indonesia", "Iran", "Iraq", "Ireland {Republic}",
"Israel", "Italy", "Ivory Coast", "Jamaica", "Japan", "Jordan", "Kazakhstan", "Kenya", "Kiribati",
"Korea North", "Korea South", "Kosovo", "Kuwait", "Kyrgyzstan", "Laos", "Latvia", "Lebanon", "Lesotho",
"Liberia", "Libya", "Liechtenstein", "Lithuania", "Luxembourg", "Macedonia", "Madagascar", "Malawi",
"Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Mauritania", "Mauritius", "Mexico",
"Micronesia", "Moldova", "Monaco", "Mongolia", "Montenegro", "Morocco", "Mozambique", "Myanmar, {Burma}",
"Namibia", "Nauru", "Nepal", "Netherlands", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Norway",
"Oman", "Pakistan", "Palau", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Poland",
"Portugal", "Qatar", "Romania", "Russian Federation", "Rwanda", "St Kitts & Nevis", "St Lucia",
"Saint Vincent & the Grenadines", "Samoa", "San Marino", "Sao Tome & Principe", "Saudi Arabia",
"Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia",
"Solomon Islands", "Somalia", "South Africa", "South Sudan", "Spain", "Sri Lanka", "Sudan", "Suriname",
"Swaziland", "Sweden", "Switzerland", "Syria", "Taiwan", "Tajikistan", "Tanzania", "Thailand", "Togo",
"Tonga", "Trinidad & Tobago", "Tunisia", "Turkey", "Turkmenistan", "Tuvalu", "Uganda", "Ukraine",
"United Arab Emirates", "United Kingdom", "United States", "Uruguay", "Uzbekistan", "Vanuatu",
"Vatican City", "Venezuela", "Vietnam", "Yemen", "Zambia", "Zimbabwe"]
}
# The passcodes will print out on the console
# TWO_FACTOR_CALL_GATEWAY = 'two_factor.gateways.fake.Fake'
# TWO_FACTOR_SMS_GATEWAY = 'two_factor.gateways.fake.Fake'