Skip to content

Commit 5c748b4

Browse files
committed
config interpolation, add user and db explicitly to make obvious that you can set these things
1 parent f4ee53d commit 5c748b4

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

samples/django-channels-redis-postgres/README.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ The secret key for your Django application. You can generate a new one by runnin
2929
### `POSTGRES_PASSWORD`
3030
The password for your Postgres database. You need to set this before deploying for the first time.
3131

32-
### `POSTGRES_URL`
33-
The URL for your Postgres database (which should include the password set with `POSTGRES_PASSWORD`). This should be in the format `postgres://<username>:<password>@<host>:<port>/<database>`
34-
35-
3632
## Deploying
3733

3834
1. Open the terminal and type `defang login`

samples/django-channels-redis-postgres/compose.dev.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
healthcheck: {}
99
environment:
1010
REDIS_URL: redis://redis-service:6379
11-
POSTGRES_URL: postgres://user:password@postgres-service:5432/db
11+
POSTGRES_URL: postgres://djangouser:djangopassword@postgres-service:5432/djangodatabase
1212
DEBUG: "True"
1313
depends_on:
1414
- redis-service
@@ -25,9 +25,9 @@ services:
2525
file: compose.yaml
2626
service: postgres-service
2727
environment:
28-
POSTGRES_USER: user
29-
POSTGRES_PASSWORD: password
30-
POSTGRES_DB: db
28+
POSTGRES_DB: djangodatabase
29+
POSTGRES_USER: djangouser
30+
POSTGRES_PASSWORD: djangopassword
3131
volumes:
3232
- postgres_data:/var/lib/postgresql/data
3333

samples/django-channels-redis-postgres/compose.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ services:
1111
mode: ingress
1212
environment:
1313
REDIS_URL: redis://redis-service:6379
14-
POSTGRES_URL: "postgres://postgres:${POSTGRES_PASSWORD}@postgres-service:5432/postgres?sslmode=require"
14+
POSTGRES_URL: "postgres://djangouser:${POSTGRES_PASSWORD}@postgres-service:5432/djangodatabase?sslmode=require"
1515
SECRET_KEY:
1616
healthcheck:
1717
# wget or curl required for healthchecks on services with a published port
@@ -33,3 +33,5 @@ services:
3333
target: 5432
3434
environment:
3535
POSTGRES_PASSWORD:
36+
POSTGRES_DB: djangodatabase
37+
POSTGRES_USER: djangouser

0 commit comments

Comments
 (0)