Skip to content

Commit 5b0d5a8

Browse files
authored
Merge pull request #24 from farooq13/base
db connection
2 parents 9f179cb + ce02f3b commit 5b0d5a8

File tree

5 files changed

+6
-3
lines changed

5 files changed

+6
-3
lines changed

db.sqlite3

0 Bytes
Binary file not shown.

requirements.txt

222 Bytes
Binary file not shown.

trendy/.env

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
ENVIROMENT=development
22
SECRET_KEY=django-insecure-^kf9lb-c&@uv3tj1+1#k21kmdg6jnh(-39-5&zmt139iwu1!p!
3-
4-
# ENVIROMENT=development
5-
# SECRET_KEY=django-insecure-^kf9lb-c&@uv3tj1+1#k21kmdg6jnh(-39-5&zmt139iwu1!p!
3+
DATABASE_URL=postgresql://trendify_postgresql_user:gYNHjtiyhU0Q6MGYWqWO7nGIr69bLffe@dpg-cunniohopnds73da9q4g-a.oregon-postgres.render.com/trendify_postgresql
197 Bytes
Binary file not shown.

trendy/settings.py

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11

22
from pathlib import Path
3+
import dj_database_url
34

45
from environ import Env
56
env = Env()
@@ -119,6 +120,10 @@
119120
}
120121
}
121122

123+
POSTGRES_LOCALLY = False
124+
125+
if ENVIROMENT == 'production' or POSTGRES_LOCALLY == True:
126+
DATABASES['default'] = dj_database_url.parse(env('DATABASE_URL'))
122127

123128
# Password validation
124129
# https://docs.djangoproject.com/en/5.0/ref/settings/#auth-password-validators

0 commit comments

Comments
 (0)