From e2c27bd2e1e7db6ed7e2c6092c050320c140c276 Mon Sep 17 00:00:00 2001 From: Anatoly Date: Thu, 17 Oct 2019 13:40:52 +0300 Subject: [PATCH] switched broker storage from rabbtimq to redis --- project/settings/base.py | 5 ++++- project/settings/local.py | 7 +++++-- requirements/base.txt | 9 ++++++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/project/settings/base.py b/project/settings/base.py index 5c32f263..f89eff8d 100644 --- a/project/settings/base.py +++ b/project/settings/base.py @@ -317,7 +317,10 @@ REDOC_SETTINGS = { } # CELERY -BROKER_URL = 'amqp://rabbitmq:5672' +# RabbitMQ +# BROKER_URL = 'amqp://rabbitmq:5672' +# Redis +BROKER_URL = 'redis://base:6379/1' CELERY_RESULT_BACKEND = BROKER_URL CELERY_BROKER_URL = BROKER_URL CELERY_ACCEPT_CONTENT = ['application/json'] diff --git a/project/settings/local.py b/project/settings/local.py index a644e9b8..31fe88c2 100644 --- a/project/settings/local.py +++ b/project/settings/local.py @@ -6,7 +6,7 @@ ALLOWED_HOSTS = ['*', ] SEND_SMS = False SMS_CODE_SHOW = True -USE_CELERY = False +USE_CELERY = True SCHEMA_URI = 'http' DEFAULT_SUBDOMAIN = 'www' @@ -14,7 +14,10 @@ SITE_DOMAIN_URI = 'testserver.com:8000' DOMAIN_URI = '0.0.0.0:8000' # CELERY -BROKER_URL = 'amqp://rabbitmq:5672' +# RabbitMQ +# BROKER_URL = 'amqp://rabbitmq:5672' +# Redis +BROKER_URL = 'redis://redis:6379/1' CELERY_RESULT_BACKEND = BROKER_URL CELERY_BROKER_URL = BROKER_URL diff --git a/requirements/base.txt b/requirements/base.txt index 716d21c6..5c734322 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -15,8 +15,6 @@ djangorestframework==3.9.4 markdown django-filter==2.1.0 djangorestframework-xml -celery -amqp>=2.4.0 geoip2==2.9.0 django-phonenumber-field[phonenumbers]==2.1.0 @@ -33,4 +31,9 @@ djangorestframework-simplejwt==4.3.0 django-elasticsearch-dsl>=7.0.0,<8.0.0 django-elasticsearch-dsl-drf==0.20.2 -sentry-sdk==0.11.2 \ No newline at end of file +sentry-sdk==0.11.2 + +# temp solution +redis==3.2.0 +amqp>=2.4.0 +celery==4.3.0rc2 \ No newline at end of file