mirror of
https://github.com/HackSoftware/Django-Styleguide.git
synced 2024-11-10 19:56:40 +03:00
Improve Prefixing environment variables with Django_
This commit is contained in:
parent
645c7214b8
commit
14608aac26
|
@ -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.**
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user