But then you have to explicitly pass the context to everything you call.
Dynamic scoping would solve this problem (and similar problems, like dependency injection), but Python doesn't have that.
Flasks way emulates it as well as possible.
Dynamic scoping would solve this problem (and similar problems, like dependency injection), but Python doesn't have that.
Flasks way emulates it as well as possible.
It would be so much simpler to just have a request argument passed to each view.