Just a small addition to the documentation for accessing named URL patterns at:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
See email exchange between myself and Malcolm below...
On Sat, 2007-04-21 at 01:47 -0700, Michael wrote:
I'm not sure if this is obvious, but the documentation at:
http://www.djangoproject.com/documentation/url_dispatch/#naming-url-patterns
doesn't mention how you can use your named URL patters to redirect
from one view to another. It only shows how you can get the url for a
view from within a template.
Anyways, turns out to be pretty simple (found it in the source
django_src/django/template/defaulttags.py):
from django.core.urlresolvers import reverse
return HttpResponseRedirect?( reverse( 'your-url-name' ) )
Have I missed something and this was documented else where? Otherwise
I'll raise a ticket to update the above documentation for named url
patterns...
We haven't documented reverse() anywhere, as far as I know. So worth
filing a ticket.
Thanks,
Malcolm