From 14608aac26ec1a0d971652f5059e3998c5faeabf Mon Sep 17 00:00:00 2001 From: Krasi Date: Tue, 23 Apr 2024 13:30:22 +0300 Subject: [PATCH] Improve Prefixing environment variables with Django_ --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8590cb8..51706cb 100644 --- a/README.md +++ b/README.md @@ -1510,9 +1510,11 @@ from config.settings.sentry import * # noqa ### Prefixing environment variables with `DJANGO_` -In a lot of examples, you'll see that environment variables are usually prefixed with `DJANGO_`. This is very helpful when there are other applications running alongside your Django app & reading from the same environment. +In a lot of examples, you'll see that environment variables are usually prefixed with `DJANGO_`. This is very helpful when there are other applications alongside your Django app that run on the same environment. In that case, prefixing the environment variables with `DJANGO_` helps you to differ which are the environment variables specific to your Django app. -We tend to prefix with `DJANGO_` only `DJANGO_SETTINGS_MODULE` and `DJANGO_DEBUG` & not prefix anything else. +In HackSoft we do not ususally have several apps running on the same environment. So, we tend to prefix with `DJANGO_` only the Django specific environments & anything else. + +For example, we would have `DJANGO_SETTINGS_MODULE`, `DJANGO_DEBUG`, `DJANGO_ALLOWED_HOSTS`, `DJANGO_CORS_ORIGIN_WHITELIST` prefixed. We would have `AWS_SECRET_KEY`, `CELERY_BROKER_URL`, `EMAILS_ENABLED` not prefixed. This is mostly up to personal preference. **Just make sure you are consistent with that.**