Flask SQLAlchemy display queries for debug

后端 未结 8 1222
感情败类
感情败类 2021-02-03 17:21

I am developing an app with flask and SQL Alchemy. I need to display the queries executed to generate a page alongside the time each query took for debugging

What\'s the

8条回答
  •  粉色の甜心
    2021-02-03 17:59

    I haven't used it myself, but it seems that Flask Debug-toolbar may help with this.

    https://github.com/mgood/flask-debugtoolbar

    It's a port of the django-debug-toolbar, which can be used for profiling queries. The documentation of Flask Debug-toolbar doesn't mention it, but there is code for a SQLAlchemyDebugPanel.
    So I think it may be well worth to take a look at the project, and see if it does what you need.

提交回复
热议问题