我用的intellij idea,如果是pycharm也是一样的。

比如我要调试superset,首先:

Debug configurations->左上角+号->python

superset是gunicorn启动的,那就在script path输入gunicorn的地址。

比如我的就是:

/home/justeene/IdeaProjects/sqlalchemy-clickhouse/venv/bin/gunicorn

然后在parameters里输出启动参数:

-w 2 --timeout 60 -b  0.0.0.0:8088 --limit-request-line 0 --limit-request-field_size 0 superset:app

然后点apply。

我的配置如下:

python调试module教程

接下来打个断点,我打在web/core.py的testconn函数上:

python调试module教程

点debug开始调试

python调试module教程

成功进入断点,调用栈和变量值都显示了。

相关文章:

  • 2021-06-03
  • 2021-07-25
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-26
  • 2021-12-12
  • 2021-04-20
  • 2022-12-23
  • 2022-12-23
  • 2021-04-14
相关资源
相似解决方案