2👍
✅
With your case. I think you should use reverse because of you do not hard code link, use only change name url.py and do not change your code.
from django.core.urlresolvers import reverse
def add(request):
# Do something
return redirect('register_index')
Howerver with url have parameter.I have a example
urls.py
url(r'^detail/(?P<pk>\d+)/$', views.show_detail, name='author_detail'),
view.py
def view_detail(request):
return HttpResponseRedirect(reverse('author_detail', kwargs={'pk': self.pk}))
Source:stackexchange.com