· 7 years ago · Oct 09, 2018, 11:44 PM
1import os
2from kombu import Queue, Exchange
3
4BASEDIR = os.path.abspath(os.path.dirname(__file__))
5
6
7class Config(object):
8 DEBUG = False
9 SECRET_KEY = os.urandom(32)
10
11 SQLALCHEMY_TRACK_MODIFICATIONS = False
12 SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL', SQLITE_DB)
13
14 CELERY_TIMEZONE = 'US/Eastern'
15 CELERY_BROKER_URL = 'amqp://localhost/'
16 CELERY_RESULT_BACKEND = 'rpc://'
17
18 # define the tasks queues
19 CELERY_QUEUES = (
20 Queue('default', Exchange('default'), routing_key='default')
21 )
22
23 # define the task routes
24 CELERY_ROUTES = {
25 'default': {'queue': 'default', 'routing_key': 'default'}
26 }
27
28
29class DevelopmentConfig(Config):
30 DEBUG = True
31
32
33class ProductionConfig(Config):
34 DEBUG = False
35
36
37config = {
38 'development': DevelopmentConfig,
39 'production': ProductionConfig
40}