Integration with Sanic
Using peewee in a Sanic project and got `Error 2006: MySQL server has gone away`. After implementation of handler in request and response middleware, the error has gone and the application runs well. 