from django.shortcuts import redirect
from .models import Element
def element_info(request):
# ...
element = Element.object.get(pk=1)
return redirect('element_update', pk=element.id)
def element_update(request, pk)
# ...
from django.shortcuts import redirect
def my_view(request):
# ...
return redirect('some-view-name', foo='bar')
from django.shortcuts import redirect
def optout(request):
return redirect("http://stackoverflow.com/")
from django.shortcuts import render, redirect
def redirecting(request):
return redirect("https://codingtutz.com/")
def my_view(request):
...
return redirect('/some/url/')
from django.shortcuts import redirect
LOGIN_REDIRECT_URL = 'your_url'
LOGOUT_REDIRECT_URL = 'your_url'