-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Debug configuration env variables should overwrite env variables defined in .env file #16984
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
Comments
@lowercase00 The way you're defining things, I think your Note: it did work for me when the |
@fabioz thanks, I did try with ${workspaceFolder} before the app/uwsgi.py also didn't work, I'll try setting cmd to set how it goes |
Just tried with |
Weird enough, I can't replicate the issue on a newly create Flask project with exactly the same folder structure. I've already created and recreated the venv and everything else that I could (mypy, pyenv, vscode folder etc). Any tips ou troubleshooting this? I've got no messages at all at the developers console, so really no idea what could be the issue. |
Are there any version differences in the packages between the two environments, if you look inside |
So finally found out the issue. I had an old |
From debugpy perspective, it doesn't actually know anything about But I agree that launch.json should take priority - |
Environment data
python.languageServer
setting: "Default"Expected behaviour
"env" portion of
launch.json
doesn't seem to work.When trying to launch a Flask application I have the following tree structure:
My
launch.json
file is:When running the debugger Flask says it can't find
application
and the first line shows:So from what I can understand it is as if the env var "FLASK_APP=app/uwsgi.py" is not being read, so it loads the default "application", and can't find the app.
Tried without the debugger and works fine (
FLASK_APP=app/uwsgi.py; flask run
).Another weird thing is that when I set
it goes as for as running the server, but when trying to reach any endpoint it says
flask.cli.NoAppException: Could not import "application".
.If I remove the
FLASK_ENV
line it doesn't even run the server and gives me an error:Error: Could not import "application"
.The text was updated successfully, but these errors were encountered: