From 4fce1e9dbaa427c3ec59ff834f5bde52217850c1 Mon Sep 17 00:00:00 2001 From: Vitaliy Rudenko Date: Fri, 22 Sep 2023 10:45:22 +0700 Subject: [PATCH] Settings to postgres --- backend/foodgram/settings.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/foodgram/settings.py b/backend/foodgram/settings.py index 246ebfe..2e16fa3 100644 --- a/backend/foodgram/settings.py +++ b/backend/foodgram/settings.py @@ -74,22 +74,22 @@ MEDIA_ROOT = os.path.join(BASE_DIR, 'media') -DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } -} # DATABASES = { # 'default': { -# 'ENGINE': 'django.db.backends.postgresql', -# 'NAME': os.getenv('POSTGRES_DB', 'django'), -# 'USER': os.getenv('POSTGRES_USER', 'django'), -# 'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''), -# 'HOST': os.getenv('DB_HOST', ''), -# 'PORT': os.getenv('DB_PORT', 5432) +# 'ENGINE': 'django.db.backends.sqlite3', +# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), # } # } +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.postgresql', + 'NAME': os.getenv('POSTGRES_DB', 'django'), + 'USER': os.getenv('POSTGRES_USER', 'django'), + 'PASSWORD': os.getenv('POSTGRES_PASSWORD', ''), + 'HOST': os.getenv('DB_HOST', ''), + 'PORT': os.getenv('DB_PORT', 5432) + } +} REST_FRAMEWORK = {