Skip to content

Saleor Core: the high performance, composable, headless commerce API.

Add basic Celery settings

Jakub Draganekea2fa4ce9d30
diff --git a/requirements.in b/requirements.in
index e9a2e3624e..53c542d06a 100644
--- a/requirements.in
+++ b/requirements.in
@@ -17,6 +17,7 @@ django-storages>=1.4.1
django-templated-email>=2.2.0
django-versatileimagefield>=1.0.1
django-webpack-loader>=0.3.0
+django-celery-results
elasticsearch>=5.4
faker>=0.7.7
google-measurement-protocol
diff --git a/requirements.txt b/requirements.txt
index ac07a399c2..b58a7e871d 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -22,6 +22,7 @@ dj-database-url==0.4.2
dj-email-url==0.0.10
django-bootstrap3==9.0.0
django-cache-url==1.3.1
+django-celery-results==1.0.1
django-countries==4.6.1
django-filter==1.0.4
django-mptt==0.8.7
diff --git a/saleor/settings.py b/saleor/settings.py
index a72cf5a32c..fdda7970c3 100644
--- a/saleor/settings.py
+++ b/saleor/settings.py
@@ -402,3 +402,11 @@ SOCIAL_AUTH_USER_MODEL = AUTH_USER_MODEL
SOCIAL_AUTH_FACEBOOK_SCOPE = ['email']
SOCIAL_AUTH_FACEBOOK_PROFILE_EXTRA_PARAMS = {
'fields': 'id, email'}
+
+# CELERY SETTINGS
+BROKER_URL = os.environ.get('REDIS_BROKER_URL') or ''
+CELERY_TASK_ALWAYS_EAGER = False if BROKER_URL else True
+CELERY_ACCEPT_CONTENT = ['json']
+CELERY_TASK_SERIALIZER = 'json'
+CELERY_RESULT_SERIALIZER = 'json'
+CELERY_RESULT_BACKEND = 'django-db'
\ No newline at end of file