def login_please_decorator(view_func):
    """
        Redirect if admin was not logged in
    """

def _decorated(request, *args, **kwargs):
    pass
How to run a piece of code in every view in django?