From 3c1ecb2913389d3b34b35fbe6b669661267101d3 Mon Sep 17 00:00:00 2001 From: Cemre Mengu Date: Fri, 15 Apr 2022 15:54:44 +0300 Subject: [PATCH 1/3] docs(contributing): add local vscode config Add simple example launch.json file for local backend debugging --- CONTRIBUTING.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 865d4b62d6b44..ad8fdf653f44c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -864,6 +864,35 @@ npm run cypress open ### Debugging Server App +For debugging locally using VSCode, you can configure a launch configuration file .vscode/launch.json such as + +```json +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Flask", + "type": "python", + "request": "launch", + "module": "flask", + "env": { + "FLASK_APP": "superset", + "FLASK_ENV": "development" + }, + "args": [ + "run", + "-p 8088", + "--with-threads", + "--reload", + "--debugger" + ], + "jinja": true, + "justMyCode": true + } + ] +} +``` + Follow these instructions to debug the Flask app running inside a docker container. First add the following to the ./docker-compose.yaml file @@ -941,7 +970,7 @@ tcp 0 0 0.0.0.0:8088 0.0.0.0:* LISTEN You are now ready to attach a debugger to the process. Using VSCode you can configure a launch configuration file .vscode/launch.json like so. -``` +```json { "version": "0.2.0", "configurations": [ From 69b4b6a81f7da27e0fb712748191b7df2b8d7d22 Mon Sep 17 00:00:00 2001 From: Cemre Mengu Date: Fri, 15 Apr 2022 18:10:10 +0300 Subject: [PATCH 2/3] add section headers --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ad8fdf653f44c..a090b15230342 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -864,6 +864,8 @@ npm run cypress open ### Debugging Server App +#### Locally + For debugging locally using VSCode, you can configure a launch configuration file .vscode/launch.json such as ```json @@ -893,6 +895,8 @@ For debugging locally using VSCode, you can configure a launch configuration fil } ``` +#### Docker container + Follow these instructions to debug the Flask app running inside a docker container. First add the following to the ./docker-compose.yaml file From 9ecd166307b62d27ca9512b536a8db12b6550ba0 Mon Sep 17 00:00:00 2001 From: Cemre Mengu Date: Fri, 15 Apr 2022 18:12:42 +0300 Subject: [PATCH 3/3] Update CONTRIBUTING.md --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a090b15230342..128c4ca84fa65 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -864,7 +864,7 @@ npm run cypress open ### Debugging Server App -#### Locally +#### Local For debugging locally using VSCode, you can configure a launch configuration file .vscode/launch.json such as @@ -895,7 +895,7 @@ For debugging locally using VSCode, you can configure a launch configuration fil } ``` -#### Docker container +#### Docker Follow these instructions to debug the Flask app running inside a docker container.