diff options
| author | Casey Duncan <casey.duncan@gmail.com> | 2010-11-22 17:42:11 -0700 |
|---|---|---|
| committer | Casey Duncan <casey.duncan@gmail.com> | 2010-11-22 17:42:11 -0700 |
| commit | b890a2026f467e3470cb1fa316317883e96d605e (patch) | |
| tree | 20fe348d9d296604a68bd4114766634380159bef /docs | |
| parent | 51bed35bfb3bb862034514da257a348e33d53860 (diff) | |
| download | pyramid-b890a2026f467e3470cb1fa316317883e96d605e.tar.gz pyramid-b890a2026f467e3470cb1fa316317883e96d605e.tar.bz2 pyramid-b890a2026f467e3470cb1fa316317883e96d605e.zip | |
reword paragraph explaining append_slash_notfound_view for clarity
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/narr/urldispatch.rst | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/docs/narr/urldispatch.rst b/docs/narr/urldispatch.rst index 7c7624d4f..3483c8b9f 100644 --- a/docs/narr/urldispatch.rst +++ b/docs/narr/urldispatch.rst @@ -1072,12 +1072,14 @@ Redirecting to Slash-Appended Routes ------------------------------------ For behavior like Django's ``APPEND_SLASH=True``, use the -:func:`pyramid.view.append_slash_notfound_view` view as the -:term:`Not Found view` in your application. When this view is the Not -Found view (indicating that no view was found), and any routes have -been defined in the configuration of your application, if the value of -``PATH_INFO`` does not already end in a slash, and if the value of -``PATH_INFO`` *plus* a slash matches any route's pattern, it does an +:func:`pyramid.view.append_slash_notfound_view` view as the :term:`Not +Found view` in your application. Defining this view as the :term:`Not +Found view` is a way to automatically redirect requests where the URL +lacks a trailing slash, but requires one to match the proper route. +When configured, along with at least one other route in your +application, this view will be invoked if the value of ``PATH_INFO`` +does not already end in a slash, and if the value of ``PATH_INFO`` +*plus* a slash matches any route's pattern. In this case it does an HTTP redirect to the slash-appended ``PATH_INFO``. Let's use an example, because this behavior is a bit magical. If the |
