class LocalManager:
Local objects cannot manage themselves. For that you need a local
manager. You can pass a local manager multiple locals or add them
later by appending them to manager.locals
. Every time the manager
cleans up, it will clean up all the data left in the locals for this
context.
release_local
function can be used instead of a
manager.Method | __init__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | cleanup |
Manually clean up the data in the locals for this context. Call this at the end of the request or use make_middleware() . |
Method | get_ident |
No summary |
Method | ident_func.setter |
Undocumented |
Method | make_middleware |
Wrap a WSGI application so that cleaning up happens after request end. |
Method | middleware |
Like make_middleware but for decorating functions. |
Instance Variable | locals |
Undocumented |
Property | ident_func |
Undocumented |
Undocumented
Parameters | |
locals:t.Optional[ | Undocumented |
ident_func:None | Undocumented |
make_middleware()
.Return the context identifier the local objects use internally for this context. You cannot override this method to change the behavior but use it to link other context local objects (such as SQLAlchemy's scoped sessions) to the Werkzeug locals.
Returns | |
int | Undocumented |
Parameters | |
app:WSGIApplication | Undocumented |
Returns | |
WSGIApplication | Undocumented |
Like make_middleware
but for decorating functions.
Example usage:
@manager.middleware def application(environ, start_response): ...
The difference to make_middleware
is that the function passed
will have all the arguments copied from the inner application
(name, docstring, module).
Parameters | |
func:WSGIApplication | Undocumented |
Returns | |
WSGIApplication | Undocumented |