from django.urls import reverse def myview(request): return HttpResponseRedirect(reverse('url_name'))