Django also provides a way to translate URLs according to the active
language. See the :ref:`internationalization documentation
<url-internationalization>` for more information.
.. _how-django-processes-a-request:
@@ -154,11 +154,12 @@ The matching/grouping algorithm
Here's the algorithm the URLconf parser follows, with respect to named groups
vs. non-named groups in a regular expression:
If there are any named arguments, it will use those, ignoring non-named arguments.
Otherwise, it will pass all non-named arguments as positional arguments.
1. If there are any named arguments, it will use those, ignoring non-named
arguments.
In both cases, it will pass any extra keyword arguments as keyword arguments.
See "Passing extra options to view functions" below.
2. Otherwise, it will pass all non-named arguments as positional arguments.
In both cases, any extra keyword arguments that have been given as per `Passing extra options to view functions`_ (below) will also be passed to the view.
What the URLconf searches against
=================================
@@ -176,6 +177,44 @@ The URLconf doesn't look at the request method. In other words, all request
methods -- ``POST``, ``GET``, ``HEAD``, etc. -- will be routed to the same
function for the same URL.
Notes on capturing text in URLs
===============================
Each captured argument is sent to the view as a plain Python string, regardless
of what sort of match the regular expression makes. For example, in this