Skip to content
This repository has been archived by the owner on Apr 12, 2023. It is now read-only.

Connection to PROD Db utilizing ENV variable #53

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ cp .env.sample .env

Now edit .env fill the generated `.env` file with your credentials to run it locally.

## Database

For the Database to be used(in Production),
you can export the connection url in `DATABASE_URL`,
eg,
```sh
$ export DATABASE_URL=postgres://postgres:[email protected]:5432/test
```

## Running

```sh
Expand Down
9 changes: 1 addition & 8 deletions certificate_generator/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,7 @@
}
else:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': config('DB_NAME'),
'USER': config('DB_USER'),
'PASSWORD': config('DB_PASSWORD'),
'HOST': config('DB_HOST'),
'PORT': config('DB_PORT'),
}
'default': dj_database_url.config(default=os.getenv('DATABASE_URL'))
isaac-philip marked this conversation as resolved.
Show resolved Hide resolved
}


Expand Down