I am not sure if you're aware of Flask, Flask is a microframework for Python.

It provides something called "Blueprints", you can register e.g. "routes" to this Blueprint and to use them you've to add them to the main application. This makes code way more readable! Also some kind of after_request and before_request handlers would be great, you could use them e.g. fetching a user from the database and providing it to the handler (over a thread-local?).

Reply via email to