werkzeug.LocalManager

class werkzeug.LocalManager(locals=None, ident_func=None)[source]

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. Everytime the manager cleans up it, will clean up all the data left in the locals for this context.

The ident_func parameter can be added to override the default ident function for the wrapped locals.

Changed in version 0.6.1: Instead of a manager the release_local() function can be used as well.

Changed in version 0.7: ident_func was added.

Methods

__init__([locals, ident_func])
cleanup() Manually clean up the data in the locals for this context.
get_ident() Return the context identifier the local objects use internally for this context.
make_middleware(app) Wrap a WSGI application so that cleaning up happens after request end.
middleware(func) Like make_middleware but for decorating functions.