In this problem, create a Flask app and see how to configure the ProfileMiddleware to add columns to sort. For this example, we will sort by two columns tottime and cumtime, which are output in profiling logs. Complete the below code
- Add the necessary
ProfileMiddlewarecode to enable profiling; - Make sure you use
sort_by_columnsto pass the variables to sort by; - Follow the middleware initialization practices of Flask of using
app.wsgi_app.