From 9faca2999d4a00417399a944fc5888cfbc25e776 Mon Sep 17 00:00:00 2001 From: Sumit Kumar Date: Tue, 9 May 2023 02:54:49 +0700 Subject: [PATCH] Use local postgres and redis (#419) --- mysterio/settings/base.py | 7 +++++++ mysterio/settings/local.py | 9 --------- mysterio/settings/production.py | 11 ----------- 3 files changed, 7 insertions(+), 20 deletions(-) diff --git a/mysterio/settings/base.py b/mysterio/settings/base.py index 246094e4..8e5b7412 100644 --- a/mysterio/settings/base.py +++ b/mysterio/settings/base.py @@ -114,9 +114,16 @@ CHANNEL_LAYERS = { "default": { "BACKEND": "channels_redis.core.RedisChannelLayer", + "CONFIG": { + "hosts": ["redis://127.0.0.1:6379"], + }, } } +CELERY_BROKER_URL = "redis://127.0.0.1:6379" + +CELERY_RESULT_BACKEND = "redis://127.0.0.1:6379" + # Password validation # https://docs.djangoproject.com/en/3.1/ref/settings/#auth-password-validators diff --git a/mysterio/settings/local.py b/mysterio/settings/local.py index a408f9db..20db30ee 100644 --- a/mysterio/settings/local.py +++ b/mysterio/settings/local.py @@ -17,15 +17,6 @@ INSTALLED_APPS.append("django_extensions") -CHANNEL_LAYERS["default"]["CONFIG"] = { - "hosts": ["redis://127.0.0.1:6379"], -} - - -CELERY_BROKER_URL = "redis://127.0.0.1:6379" - -CELERY_RESULT_BACKEND = "redis://127.0.0.1:6379" - SITE_ID = 4 diff --git a/mysterio/settings/production.py b/mysterio/settings/production.py index ced03cfb..427feac6 100644 --- a/mysterio/settings/production.py +++ b/mysterio/settings/production.py @@ -1,4 +1,3 @@ -import dj_database_url from core import secret_manager secret_manager.load_secrets() @@ -13,11 +12,6 @@ "mysterio-env.eba-jmukjigp.ap-south-1.elasticbeanstalk.com", ] -DATABASES = {"default": dj_database_url.config(conn_max_age=600)} - -CHANNEL_LAYERS["default"]["CONFIG"] = { - "hosts": [os.getenv("REDIS_URL")], -} TEMPLATES[0]["DIRS"] = [ os.path.join(FRONTEND_DIR, "dist"), @@ -28,11 +22,6 @@ ] -CELERY_BROKER_URL = os.getenv("REDIS_URL") - -CELERY_RESULT_BACKEND = os.getenv("REDIS_URL") - - SITE_ID = 3 LOGGING["loggers"] = {