Ticket #4103: url_dispatch2.diff

File url_dispatch2.diff, 733 bytes (added by Simon G. <dev@…>, 17 years ago)
  • docs/url_dispatch.txt

     
    540540The string used for the URL name can contain any characters you like. You are
    541541not restricted to valid Python names.
    542542
     543Also, ``django.core.urlresolvers`` has a function ``reverse`` which allows you to
     544do the same thing outside templates, such as redirecting inside a view::
     545
     546    from django.core.urlresolvers import reverse
     547   
     548    def myview(request):
     549        return HttpResponseRedirect(reverse('arch-summary', args=[1945]))
     550
    543551.. note::
    544552
    545553    When you name your URL patterns, make sure you use names that are unlikely
Back to Top