Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sso_decorator = decorator_from_middleware_with_args(SSOMiddleware)
- @sso_decorator(True):
- def index():
- ...
- @sso_decorator(False):
- def view():
- ...
- class SSOMiddleware:
- def __init__(self, some_arg=False):
- self.some_arg = some_arg
- def process_request(self, request):
- print self.some_arg
- Some argument: False
- Some argument: True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement