In this problem, create a Flask app and see how to configure the ProfileMiddleware to add profile_dir for saving output logs. For this example, we will save the profile logs to the profile_dir variable. Complete the below code
- Add the necessary
ProfileMiddlewarecode to enable profiling; - Make sure you save the profile log using the
save_tovariable; - Follow the middleware initialization practices of Flask of using
app.wsgi_app.