Edited docs/middleware.txt changes from [6852]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6947 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2007-12-19 03:55:10 +00:00
parent 48a5898f24
commit 76f3856039
1 changed files with 9 additions and 8 deletions

View File

@ -61,17 +61,18 @@ Adds a few conveniences for perfectionists:
settings. settings.
If ``APPEND_SLASH`` is ``True`` and the initial URL doesn't end with a slash, If ``APPEND_SLASH`` is ``True`` and the initial URL doesn't end with a slash,
and it is not found in urlpatterns, a new URL is formed by appending a slash and it is not found in the URLconf, then a new URL is formed by appending a
at the end. If this new URL is found in urlpatterns, then an HTTP-redirect is slash at the end. If this new URL is found in the URLconf, then Django
returned to this new URL; otherwise the initial URL is processed as usual. redirects the request to this new URL. Otherwise, the initial URL is
processed as usual.
So ``foo.com/bar`` will be redirected to ``foo.com/bar/`` if you do not For example, ``foo.com/bar`` will be redirected to ``foo.com/bar/`` if you
have a valid urlpattern for ``foo.com/bar``, and do have a valid urlpattern don't have a valid URL pattern for ``foo.com/bar`` but *do* have a valid
for ``foo.com/bar/``. pattern for ``foo.com/bar/``.
**New in Django development version:** The behavior of ``APPEND_SLASH`` has **New in Django development version:** The behavior of ``APPEND_SLASH`` has
changed slightly in the development version. It didn't used to check to see changed slightly in the development version. It didn't used to check whether
whether the pattern was matched in the URLconf. the pattern was matched in the URLconf.
If ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be If ``PREPEND_WWW`` is ``True``, URLs that lack a leading "www." will be
redirected to the same URL with a leading "www." redirected to the same URL with a leading "www."