In all cases below, the .env file will exist outside of the Django project and will be referenced from the settings file. This allows you to customize and secure each environment while automating the whole build.
DevelopersLocal settings will point tot he location of the .env file.
This file is excluded from git via gitignore.
Developers push to your repo's development branch which updates your development server after passing CI/CD
- Developer 1 - /developer1Machine/whatever/unique path/.env
- Developer 2 - /unique path/.env/unique path/.env
Development environment
Developer settings references its own or same .env file path location
This directory and .env file permissions are secured such that only the process running the web server has access to it and admin. So you may be bale to log on to the server but won't be able to see this file and or directory if you are not allowed to or in the right security group based on your role.
Staging environment
Can be configured like development with staging desired tweaks.
Testing and QA happens here prior to push to production
Production environment
Can be configured like staging.