File tree Expand file tree Collapse file tree 3 files changed +4
-17
lines changed
samples/django-channels-redis Expand file tree Collapse file tree 3 files changed +4
-17
lines changed Original file line number Diff line number Diff line change 16
16
import urllib .parse
17
17
18
18
19
- # print redis and postgres urls
20
- print ('@@@@@@@ DEBUG @@@@@@@' )
21
- print (f'redis: { os .getenv ("REDIS_URL" , None )} ' )
22
- print (f'postgres: { os .getenv ("POSTGRES_URL" , None )} ' )
23
- print (f'postgres_password: { os .getenv ("POSTGRES_PASSWORD" , None )} ' )
24
- postgres_url = os .getenv ("POSTGRES_URL" , None )
25
- postgres_password = os .getenv ("POSTGRES_PASSWORD" , None )
26
- fixed_postgres_url = postgres_url .replace ("password" , postgres_password ) if postgres_url and postgres_password else postgres_url
27
- print (f'fixed_postgres_url: { fixed_postgres_url } ' )
28
- print ('@@@@@@@ DEBUG @@@@@@@' )
29
-
30
-
31
19
# Build paths inside the project like this: BASE_DIR / 'subdir'.
32
20
BASE_DIR = Path (__file__ ).resolve ().parent .parent
33
21
99
87
DATABASES = {
100
88
# default is a postrgres database load from environment variable POSTGRES_URL
101
89
"default" : dj_database_url .config (
102
- default = fixed_postgres_url
90
+ default = os . getenv ( "POSTGRES_URL" , None )
103
91
)
104
92
}
105
93
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ services:
13
13
depends_on :
14
14
- redis_service
15
15
- postgres_service
16
- command : python manage.py runserver 0.0.0.0:8000
16
+ command : sh -c " python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
17
17
18
18
redis_service :
19
19
extends :
Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ services:
13
13
mode : ingress
14
14
environment :
15
15
REDIS_URL : redis://redis_service:6379
16
- POSTGRES_URL : postgres://postgres:password@postgres_service:5432/postgres
17
- POSTGRES_PASSWORD : testtest
16
+ POSTGRES_URL :
18
17
healthcheck :
19
18
# wget or curl required for healthchecks on services with a published port
20
19
# this gets parsed by Defang and provided to the load balancers as well
@@ -34,4 +33,4 @@ services:
34
33
- mode : host
35
34
target : 5432
36
35
environment :
37
- POSTGRES_PASSWORD : testtest
36
+ POSTGRES_PASSWORD :
You can’t perform that action at this time.
0 commit comments