Compare commits
2 commits
f177ab165e
...
929d61e12c
Author | SHA1 | Date | |
---|---|---|---|
|
929d61e12c | ||
|
cd0dba93fb |
2 changed files with 9 additions and 6 deletions
|
@ -6,7 +6,10 @@ services:
|
|||
ports:
|
||||
- 8080:8888
|
||||
environment:
|
||||
DOCKER: True
|
||||
POSTGRES_PASSWORD: development
|
||||
POSTGRES_USER: pflaenzli
|
||||
POSTGRES_DB: pflaenzli
|
||||
DJANGO_DEBUG: true
|
||||
|
||||
db:
|
||||
image: postgres:15
|
||||
|
|
|
@ -30,7 +30,7 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||
SECRET_KEY = "django-insecure-q=ps#iypevr!3zfpwtfp3lw#4r3%oyj*(2=*iq^8f4_zbodi^("
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
DEBUG = os.getenv('DJANGO_DEBUG') == 'true'
|
||||
|
||||
ALLOWED_HOSTS = os.getenv('DJANGO_ALLOWED_HOSTS', '').split(',')
|
||||
CSRF_TRUSTED_ORIGINS = os.getenv('DJANGO_CSRF_TRUSTED_ORIGINS', '').split(',')
|
||||
|
@ -85,13 +85,13 @@ WSGI_APPLICATION = "pflaenzli_django.wsgi.application"
|
|||
|
||||
# Database
|
||||
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
|
||||
if os.getenv("DOCKER"):
|
||||
if os.getenv('POSTGRES_DB') is not None:
|
||||
DATABASES = {
|
||||
'default': {
|
||||
'ENGINE': 'django.db.backends.postgresql',
|
||||
'NAME': 'pflaenzli',
|
||||
'USER': 'pflaenzli',
|
||||
'PASSWORD': 'development',
|
||||
'NAME': os.getenv('POSTGRES_DB'),
|
||||
'USER': os.getenv('POSTGRES_USER'),
|
||||
'PASSWORD': os.getenv('POSTGRES_PASSWORD'),
|
||||
'HOST': 'db',
|
||||
'PORT': '5432',
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue