Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed a few typos and updated an example in the URLs docs.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@17537 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 9d7b5558ee21bd047c1b3845d4af7540000476bf 1 parent 5b37a02
@aaugustin aaugustin authored
Showing with 15 additions and 13 deletions.
  1. +15 −13 docs/topics/http/urls.txt
View
28 docs/topics/http/urls.txt
@@ -278,7 +278,7 @@ Error handling
When Django can't find a regex matching the requested URL, or when an
exception is raised, Django will invoke an error-handling view. The
-views to use for these cases are specified by two variables which can
+views to use for these cases are specified by three variables which can
be set in your root URLconf. Setting these variables in any other
URLconf will have no effect.
@@ -291,8 +291,8 @@ handler403
.. data:: handler403
A callable, or a string representing the full Python import path to the view
-that should be called if the user has no the permissions required to access
-a resource.
+that should be called if the user doesn't have the permissions required to
+access a resource.
By default, this is ``'django.views.defaults.permission_denied'``. That default
value should suffice.
@@ -440,15 +440,18 @@ Including other URLconfs
At any point, your ``urlpatterns`` can "include" other URLconf modules. This
essentially "roots" a set of URLs below other ones.
-For example, here's the URLconf for the `Django Web site`_ itself. It includes a
-number of other URLconfs::
+For example, here's an except of the URLconf for the `Django Web site`_
+itself. It includes a number of other URLconfs::
from django.conf.urls import patterns, url, include
urlpatterns = patterns('',
- (r'^weblog/', include('django_website.apps.blog.urls.blog')),
- (r'^documentation/', include('django_website.apps.docs.urls.docs')),
- (r'^comments/', include('django.contrib.comments.urls')),
+ # ... snip ...
+ (r'^comments/', include('django.contrib.comments.urls')),
+ (r'^community/', include('django_website.aggregator.urls')),
+ (r'^contact/', include('django_website.contact.urls')),
+ (r'^r/', include('django.conf.urls.shortcut')),
+ # ... snip ...
)
Note that the regular expressions in this example don't have a ``$``
@@ -469,8 +472,8 @@ directly the pattern list as returned by `patterns`_ instead. For example::
)
urlpatterns = patterns('',
- url(r'^$', 'apps.main.views.homepage', name='site-homepage'),
- (r'^help/', include('apps.help.urls')),
+ url(r'^$', 'apps.main.views.homepage', name='site-homepage'),
+ (r'^help/', include('apps.help.urls')),
(r'^credit/', include(extra_patterns)),
)
@@ -972,9 +975,8 @@ A :class:`ResolverMatch` object can also be assigned to a triple::
the :class:`ResolverMatch` object (as well as the namespace and pattern
information it provides) is not available in earlier Django releases.
-One possible use of :func:`~django.core.urlresolvers.resolve` would be
-to testing if a view would raise a ``Http404`` error before
-redirecting to it::
+One possible use of :func:`~django.core.urlresolvers.resolve` would be to test
+if a view would raise a ``Http404`` error before redirecting to it::
from urlparse import urlparse
from django.core.urlresolvers import resolve
Please sign in to comment.
Something went wrong with that request. Please try again.