-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Any plan to support embedded variables? #421
Comments
The link provided refers to the proxy feature. This feature allows us to associate a specific value to various variable names. I'm looking for a more generic solution in which the variable definition can include one or more other variables along with additional text. This would allow us to re-use the content of one or more variables to create a new variable, while the current implementation only allow us to duplicate a variable.
# Current proxy feature
VAR_1=bar
VAR_2=$VAR_1
VAR_3=$VAR_1
# Desired feature
VAR_1=prod
VAR_2=my_app_name
APP_ROOT_DIR=/opt/${VAR_1}/${VAR_2} # /opt/prod/my_app_name
APP_LIB_DIR=/opt/${VAR_1}/${VAR_2}/lib # /opt/prod/my_app_name/lib
…---- On Tue, 11 Oct 2022 03:20:41 -0400 Florian Demmer ***@***.***> wrote ---
This is already supported, but with different synthax: https://django-environ.readthedocs.io/en/latest/tips.html?highlight=proxy#proxy-value
Although it might not work as expected, there were a number of issues discussing it:
https://github.com/joke2k/django-environ/issues?q=is%3Aissue+proxy+is%3Aclosed
and an open one: #415
—
Reply to this email directly, #421 (comment), or https://github.com/notifications/unsubscribe-auth/AHDKPRZBMICWLDYH3ABDPVDWCUIMTANCNFSM6AAAAAAQ7PNFME.
You are receiving this because you authored the thread.
|
invasy
added a commit
to invasy/django-environ
that referenced
this issue
Jan 8, 2023
Fix joke2k#421: add support for embedded variables.
invasy
added a commit
to invasy/django-environ
that referenced
this issue
Jan 8, 2023
Fix joke2k#421: add support for embedded variables.
invasy
added a commit
to invasy/django-environ
that referenced
this issue
Apr 24, 2023
- Expand variables referenced as `$VAR` or `${VAR}`. - Detect infinite recursion in expansion (self-reference).
Merged
sergeyklay
added a commit
that referenced
this issue
Sep 1, 2023
sergeyklay
added a commit
that referenced
this issue
Sep 1, 2023
sergeyklay
added a commit
that referenced
this issue
Sep 1, 2023
fdemmer
added a commit
to fdemmer/django-environ
that referenced
this issue
Mar 17, 2024
* develop: Test on Django 5.0 Bump actions/setup-python from 4.7.0 to 4.7.1 Bump actions/checkout from 4.0.0 to 4.1.1 Add Python 3.12 to the test matrix Make inline comments handling optional and disabled by default Bump actions/checkout from 3.6.0 to 4.0.0 Change version: v0.12.0 -> v0.11.2 Change version: v0.12.0 -> v0.11.2 Update change log Revert "Add variable expansion (fix joke2k#421)" Bump version
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was wondering if there has been discussions/plans to support embedded variables in .env file. For example,
I got used to the ${VAR_NAME} syntax as it is supported by docker-compose and python-dotenv among others. It would be great to get the same support in django-environ. I'm aware of the interpolate feature which covers a more limited use case.
Would that be useful to anyone else?
The text was updated successfully, but these errors were encountered: