-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: proposal of management of .env* parameters files in Symfony way
The proposition is to managed .env files according to Symfony standard - we load .env.template as default values. In it, APP_ENV=dev is declared - then override with content of .env.local if exists. This file is not index in git, we can overload APP_ENV=test by example - then override with content of .env.${APP_ENV} if exists. This file contains default sepcific to APP_ENV env (dev/test/prod) in addition to common default values in .env.template - then override with content of .env.${APP_ENV}.local if exists. This file is not indexed in git. For compliance with docker standard, .env is reserved to store the merged result of all variables So when all files has been parsed, the result is written in .env and reloaded from .env in bloom.config All keys are transformed to lower case ATTR=VaLue will give => settings.attr:VaLue To assure a minimal documentation of parameters, as Symfony standard in .env.dist The extracted values in all theses files MUST BE present in .env.template So for adding a new parameter, you MUST declare it in .env.template with a default value If not, this new parameters won't be available in python scripts To access settings ``` from bloom.config import settings print(settings.db_url) print(settings.postgres_user) ```
- Loading branch information
Showing
9 changed files
with
88 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -126,7 +126,8 @@ celerybeat.pid | |
|
||
# Environments | ||
.env | ||
.env.test | ||
.env.* | ||
!.env.template | ||
.venv | ||
env/ | ||
venv/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters