diff --git a/docs/topics/http/urls.txt b/docs/topics/http/urls.txt
a
|
b
|
|
40 | 40 | this is the value of the ``ROOT_URLCONF`` setting, but if the incoming |
41 | 41 | ``HttpRequest`` object has an attribute called ``urlconf``, its value |
42 | 42 | will be used in place of the ``ROOT_URLCONF`` setting. |
43 | | |
| 43 | |
44 | 44 | 2. Django loads that Python module and looks for the variable |
45 | 45 | ``urlpatterns``. This should be a Python list, in the format returned by |
46 | 46 | the function ``django.conf.urls.defaults.patterns()``. |
47 | | |
| 47 | |
48 | 48 | 3. Django runs through each URL pattern, in order, and stops at the first |
49 | 49 | one that matches the requested URL. |
50 | | |
| 50 | |
51 | 51 | 4. Once one of the regexes matches, Django imports and calls the given |
52 | 52 | view, which is a simple Python function. The view gets passed an |
53 | 53 | :class:`~django.http.HttpRequest` as its first argument and any values |
… |
… |
|
264 | 264 | ------- |
265 | 265 | |
266 | 266 | A function that takes a full Python import path to another URLconf that should |
267 | | be "included" in this place. See `Including other URLconfs`_ below. |
| 267 | be "included" in this place. |
| 268 | |
| 269 | .. versionadded:: 1.1 |
| 270 | |
| 271 | Starting with version 1.1, ``include`` now also accepts as an argument an |
| 272 | iterable of URL patterns as returned by the `patterns`_ function instead of |
| 273 | just a module string. |
| 274 | |
| 275 | See `Including other URLconfs`_ below. |
268 | 276 | |
269 | 277 | Notes on capturing text in URLs |
270 | 278 | =============================== |
… |
… |
|
391 | 399 | up to that point and sends the remaining string to the included URLconf for |
392 | 400 | further processing. |
393 | 401 | |
| 402 | .. versionadded:: 1.1 |
| 403 | |
| 404 | Another posibility is to include additional URL patterns not by specifying the |
| 405 | URLconf Python module defining them as the `include`_ argument but by using |
| 406 | directly the pattern list as returned by `patterns`_ instead. For example:: |
| 407 | |
| 408 | from django.conf.urls.defaults import * |
| 409 | |
| 410 | extra_patterns = patterns('', |
| 411 | url(r'reports/(?P<id>\d+)/$', 'credit.views.report', name='credit-reports'), |
| 412 | url(r'charge/$', 'credit.views.charge', name='credit-charge'), |
| 413 | ) |
| 414 | |
| 415 | urlpatterns = patterns('', |
| 416 | url(r'^$', 'apps.main.views.homepage', name='site-homepage'), |
| 417 | (r'^help/', include('apps.help.urls')), |
| 418 | (r'^credit/', include(extra_patterns)), |
| 419 | ) |
| 420 | |
394 | 421 | .. _`Django Web site`: http://www.djangoproject.com/ |
395 | 422 | |
396 | 423 | Captured parameters |