[Answer]-Django redirect call appends package name to url

1👍

Add a name to your project detail url:

url(r'^project/(?P<project_id>\d+)/[A-z\\-]{0,50}$',
                       views.project_detail, name='project_detail`),

And then refer to this name in redirect() call:

return redirect('project_detail', project_id=project.pk, permanent=True)

Leave a comment