8000 Use environment variables for configuration · github/codespaces-django@57ff9d2 · GitHub
[go: up one dir, main page]

Skip to content

Commit 57ff9d2

Browse files
Use environment variables for configuration
Updated configuration settings, such as `SECRET_KEY`, `DEBUG`, and `ALLOWED_HOSTS`, by replacing hardcoded values with environment variables.
1 parent 46119c0 commit 57ff9d2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

hello_world/settings.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
2121

2222
# SECURITY WARNING: keep the secret key used in production secret!
23-
SECRET_KEY = "django-insecure-rc@04_mry_3-$@2sq$b9%-9jp6q2eyxf4bsw9&&esj++aw&r)p"
23+
SECRET_KEY = os.getenv("SECRET_KEY")
2424

2525
# SECURITY WARNING: don't run with debug turned on in production!
26-
DEBUG = True
26+
DEBUG = os.getenv("DEBUG")
2727

28-
ALLOWED_HOSTS = []
28+
ALLOWED_HOSTS = os.getenv('ALLOWED_HOSTS', '').split(',')
2929

3030
if 'CODESPACE_NAME' in os.environ:
3131
codespace_name = os.getenv("CODESPACE_NAME")

0 commit comments

Comments
 (0)
0