reverse method in django code example
Example 1: django reverse
from django.urls import reverse
def myview(request):
return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
Example 2: django httpresponseredirect reverse app url
def get_success_url(self):
messages.success(self.request, 'Profile Updated Successfully')
return reverse('accounts:profile')