From 117bd424ea78b9458d50b3e7daa0b98be7605295 Mon Sep 17 00:00:00 2001 From: dom-inic Date: Tue, 28 Nov 2023 07:21:03 +0300 Subject: [PATCH] environment variables --- procentapi/settings/base.py | 17 ----------------- procentapi/settings/development.py | 8 ++++---- procentapi/settings/production.py | 10 +++++----- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/procentapi/settings/base.py b/procentapi/settings/base.py index e55f3a7..d946bbb 100644 --- a/procentapi/settings/base.py +++ b/procentapi/settings/base.py @@ -88,23 +88,6 @@ WSGI_APPLICATION = 'procentapi.wsgi.application' -# Database -# https://docs.djangoproject.com/en/4.1/ref/settings/#databases - - -# DATABASES = { -# 'default': { -# 'ENGINE': 'django.db.backends.postgresql', -# 'NAME': 'postgres', -# 'USER': 'postgres', -# 'PASSWORD': 'postgres', -# 'HOST': 'db', -# 'PORT': 5432 -# } -# } - - - # Password validation # https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators diff --git a/procentapi/settings/development.py b/procentapi/settings/development.py index 897112f..7318157 100644 --- a/procentapi/settings/development.py +++ b/procentapi/settings/development.py @@ -36,9 +36,9 @@ 'Expires': 'Sun, 27 Feb 2099 20:00:00 GMT', 'Cache-Control': 'max-age=94608000', } -REDIS_HOST = 'ec2-44-196-160-1.compute-1.amazonaws.com' -REDIS_PORT = '16340' -REDIS_DB = 1 +REDIS_HOST = os.environ['REDIS_HOST'] +REDIS_PORT = os.environ['REDIS_PORT'] +REDIS_DB = os.environ['REDIS_DB'] # Celery Configuration docker -CELERY_BROKER_URL = 'rediss://:p6da119e6d04a68daf6bfa00b216a2a45605feceee98f003355d56c3c9d177b0d@ec2-44-196-160-1.compute-1.amazonaws.com:16340' +CELERY_BROKER_URL = os.environ['CELERY_RESULT_BACKEND'] diff --git a/procentapi/settings/production.py b/procentapi/settings/production.py index e9ef368..e786d60 100644 --- a/procentapi/settings/production.py +++ b/procentapi/settings/production.py @@ -21,12 +21,12 @@ STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] -REDIS_HOST = 'ec2-52-70-18-167.compute-1.amazonaws.com' -REDIS_PORT = '23940' -REDIS_DB = 1 +REDIS_HOST = os.environ['REDIS_HOST'] +REDIS_PORT = os.environ['REDIS_PORT'] +REDIS_DB = os.environ['REDIS_DB'] # # Celery Configuration docker -CELERY_BROKER_URL = 'amqps://mnblvtxv:Sn6DfuO620YOAZ3eikewGOn4mycnV1yz@fish.rmq.cloudamqp.com/mnblvtxv' -CELERY_RESULT_BACKEND = 'redis://ec2-52-70-18-167.compute-1.amazonaws.com:23940/1' +CELERY_BROKER_URL = os.environ['CELERY_BROKER_URL'] +CELERY_RESULT_BACKEND = os.environ['CELERY_RESULT_BACKEND'] django_heroku.settings(locals(), test_runner=False) \ No newline at end of file