-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.py
53 lines (40 loc) · 1.15 KB
/
config.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
import os
from datetime import timedelta
class Config(object):
DEBUG = False
TESTING = False
REDIS_URL = os.environ['REDIS_URL']
MONGODB_SETTINGS = {
'host': os.environ['MONGOLAB_URI']}
SECRET_KEY = 'super-secret'
SECURITY_REGISTERABLE = True
SECURITY_PASSWORD_HASH = 'sha512_crypt'
SECURITY_PASSWORD_SALT = 'abcde'
MAIL_SUPPRESS_SEND = True
CELERY_TIMEZONE = 'UTC'
CELERY_IMPORTS = ['api.util']
CELERY_ACCEPT_CONTENT = ['pickle', 'json', 'msgpack', 'yaml']
BROKER_POOL_LIMIT = 0
class DevelopmentConfig(Config):
DEVELOPMENT = True
DEBUG = True
TESTING = True
CELERYBEAT_SCHEDULE = {
'requeue-every-5-seconds': {
'task': 'requeue',
'schedule': timedelta(seconds=5),
'args': ()
},
}
class Production(Config):
DEBUG = False
DEVELOPMENT = False
TESTING = False
REQUEUE_INTERVAL = int(os.environ['REQUEUE_INTERVAL'])
CELERYBEAT_SCHEDULE = {
'requeue-every-minute': {
'task': 'requeue',
'schedule': timedelta(seconds=REQUEUE_INTERVAL),
'args': ()
},
}