from django.shortcuts import redirect def my_view(request): # some code here return redirect('/some/url/', permanent=True)