def process_request(self, request): if self.enabled: if not request_is_secure(request): if request_requires_secure(request, self.paths): return redirect_secure(request) if request_is_secure(request): if not request_requires_secure(request, self.paths): return redirect_insecure(request) else: return None
def _wrapped_view_func(request, *args, **kwargs): if not request.is_secure(): if not request_is_secure(request): return redirect_secure(request) return view_func(request, *args, **kwargs)