Skip to content

Instantly share code, notes, and snippets.

@ktmud
Last active June 23, 2019 05:28
Show Gist options
  • Save ktmud/e75b0f5b706a283a763d957f345fed01 to your computer and use it in GitHub Desktop.
Save ktmud/e75b0f5b706a283a763d957f345fed01 to your computer and use it in GitHub Desktop.
VSCode Debug Redash Flask App

This is for launching and debugging Redash Flask app in VSCode.

We couldn't use the default Flask runner, because Redash implemented its own cli command manager.

We must use "program": "${workspaceFolder}/manage.py" instead of "module": "manage" because the relative path will cause some path issue, and result in template file not found errors.

{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Flask",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/manage.py",
"env": {
"FLASK_ENV": "development",
"FLASK_DEBUG": "0"
},
"args": [
"runserver",
"--no-debugger",
"--no-reload",
"--host",
"0.0.0.0"
],
"jinja": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment