Is there a way to redirect to another page in Django if it is outside the view function.
I need to be able to redirect anywhere in my application, not just when I return an HTTP response to the client.
I tried the redirect shortcut:
from django.shortcuts import redirect redirect("/some/url")
and
redirect("http://someserver.com/some/url")
but this does not cause any noticeable action.
I need something like header("Location: /some/url"); in PHP, which can be used anywhere inside the script.
thanks
source share