Project-level Environment Variables on a Project-Basis?
I find myself setting environment variables in several places routinely:
- Tools > Terminal
- Languages & Frameworks > Django
- Build, Execution, Deployment > Console > Python Console && Django Console
- Run/Debug Configurations (Django server, Celery, etc.)
I was hoping the Plugin EnvFile would apply to the entire project, but no, it doesn't.
It seems the only way to get environment variables in the consoles and terminal is to enter them in the table PyCharm control.
There is no way with EnvFile to define an .env file for these areas.
Maybe this is a feature request, but I'd like to be able to enter environment variables once and have those variables provided to all areas of the project - on a project basis.
Please sign in to leave a comment.
There's a feature request: https://youtrack.jetbrains.com/issue/PY-5543
And a workaround you could try: https://youtrack.jetbrains.com/issue/PY-5543#focus=Comments-27-712367.0-0
Also, if your env variables remain unchanged, you can set them in the terminal and then run PyCharm from this terminal session:
An unfortunate inconvenience. Thanks for informing me of the feature request.