Refs #44 -- Added optional celery background queue for mails

This commit is contained in:
Raphael Michel
2015-09-09 23:42:16 +02:00
parent 181f1fe36d
commit 101f1c77e0
7 changed files with 61 additions and 6 deletions

View File

@@ -114,6 +114,12 @@ if HAS_REDIS:
SESSION_ENGINE = "django.contrib.sessions.backends.cache"
SESSION_CACHE_ALIAS = "redis"
HAS_CELERY = config.has_option('celery', 'broker')
if HAS_CELERY:
BROKER_URL = config.get('celery', 'broker')
CELERY_RESULT_BACKEND = config.get('celery', 'backend')
CELERY_SEND_TASK_ERROR_EMAILS = bool(ADMINS)
# Internal settings
STATIC_ROOT = '_static'
@@ -330,3 +336,6 @@ LOGGING = {
}
},
}
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'