Skip to content

Commit

Permalink
To configure Django debugging setup with environment variable
Browse files Browse the repository at this point in the history
  • Loading branch information
willianantunes committed Mar 16, 2019
1 parent 7f2225a commit b44602c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
14 changes: 12 additions & 2 deletions django_graphql_playground/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,17 @@
SECRET_KEY = "7l(jg#_1_zl6ws%44mgy(nvkmb^evm9)$*7tt320w5(%qa)5(h"

# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
DEBUG = str(os.getenv("DJANGO_DEBUG", True)).lower() in (
"true",
"1",
"t",
"y",
"yes",
"yeah",
"yup",
"certainly",
"uh-huh",
)

ALLOWED_HOSTS = ["*"]

Expand Down Expand Up @@ -89,7 +99,7 @@

DATABASES = {
"default": {
"ENGINE": os.getenv("DB_ENGINER", "django.db.backends.sqlite3"),
"ENGINE": os.getenv("DB_ENGINE", "django.db.backends.sqlite3"),
"NAME": os.getenv("DB_DATABASE", os.path.join(BASE_DIR, "db.sqlite3")),
"USER": os.environ.get("DB_USER"),
"HOST": os.environ.get("DB_HOST"),
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ services:
environment:
- DJANGO_BIND_ADDRESS=0.0.0.0
- DJANGO_BIND_PORT=80
- DB_ENGINER=django.db.backends.postgresql
- DJANGO_DEBUG=True
- DB_ENGINE=django.db.backends.postgresql
- DB_DATABASE=postgres
- DB_USER=postgres
- DB_HOST=db
Expand Down

0 comments on commit b44602c

Please sign in to comment.