Ticket #4103: url_dispatch.diff

File url_dispatch.diff, 1.6 KB (added by Simon G. <dev@…>, 17 years ago)
  • tests/runtests.py

     
    141141    usage = "%prog [options] [model model model ...]"
    142142    parser = OptionParser(usage=usage)
    143143    parser.add_option('-v','--verbosity', action='store', dest='verbosity', default='0',
    144         type='choice', choices=['0', '1', '2'],
    145         help='Verbosity level; 0=minimal output, 1=normal output, 2=all output')
     144        type='choice', choices=['0', '1', '2', '3'],
     145        help='Verbosity level; 0=minimal output, 1=normal output, 2=all output, 3=all output and test information')
    146146    parser.add_option('--settings',
    147147        help='Python path to settings module, e.g. "myproject.settings". If this isn\'t provided, the DJANGO_SETTINGS_MODULE environment variable will be used.')
    148148    options, args = parser.parse_args()
  • 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