.env file evaluation appends original string
See original GitHub issuePossibly 2 issues? When using a .env
file, a value placed in the form of:
PYTHONPATH=$PYTHONPATH:$PWD/django/project:$PWD/django/project/vendor
Does not evaluate the variables. It sets it literally not the evaluated version.
>>> import os
>>> os.environ['PYTHONPATH']
'${PYTHONPATH}:${PWD}/django/project:${PWD}/django/project/vendor'
When specifying the values as:
PYTHONPATH=${PYTHONPATH}:${PWD}/django/project:${PWD}/django/project/vendor
PWD
and PYTHONPATH
are evaluated, but the original string is still prepended, leaving something like this as the final value that is set as the value of PYTHONPATH
>>> import os
>>> os.environ['PYTHONPATH']
'${PYTHONPATH}:${PWD}/django/project:${PWD}/django/project/vendor:/Users/aventurella/github/my_repo/django/project:/Users/aventurella/github/my_repo/django/project/vendor'
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Workaround to docker run "--env-file" supplied file not being ...
creating an ENV file that is nothing more than key/value pairs can be processed in normal shell commands and appended to the environment....
Read more >How to use .env file in JavaScript applications with webpack
env file. npm init. First of all, we need to create the package.json file by running: npm init.
Read more >Replace environment variables in a file with their actual values?
I want to replace $INSTANCE_ID in the file with the value of the INSTANCE_ID environment variable, $SERVICE_NAME with the value of the ...
Read more >Environment variables and app settings in Azure App Service
Signifies a connection string to a custom file share. Deployment. The following environment variables are related to app deployment. For ...
Read more >How to separate your credentials, secrets, and configurations ...
env.example file. dotenv with Python. Let's demonstrate with the python-dotenv library first. The example console application uses the library ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks ! It is not my favorite option, but does the job perfectly. Regards, M.
This is very interesting. Thanks again, it will certainly bu useful soon.