diff options
| author | Tim Graham <timograham@gmail.com> | 2013-06-11 12:25:39 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2013-06-11 12:27:09 -0400 |
| commit | b75f1f3d27d06e5fe4fdcc8e74ec3e7caeff7704 (patch) | |
| tree | 5ec6d23b5b762fb18f4faaa924ef85222a32facc | |
| parent | cd1aec65cc255d5ca6882a72714247d1106027c6 (diff) | |
[1.5.x] Fixed #20500 - Updated flatpages URLconf example to work with APPEND_SLASH.
Thanks josh.23.french@.
Backport of 536703abf0 from master
| -rw-r--r-- | docs/ref/contrib/flatpages.txt | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt index 2b54ea9776..43cd1d281d 100644 --- a/docs/ref/contrib/flatpages.txt +++ b/docs/ref/contrib/flatpages.txt @@ -82,9 +82,15 @@ to place the pattern at the end of the other urlpatterns:: # Your other patterns here urlpatterns += patterns('django.contrib.flatpages.views', - (r'^(?P<url>.*)$', 'flatpage'), + (r'^(?P<url>.*/)$', 'flatpage'), ) +.. warning:: + + If you set :setting:`APPEND_SLASH` to ``False``, you must remove the slash + in the catchall pattern or flatpages without a trailing slash will not be + matched. + Another common setup is to use flat pages for a limited set of known pages and to hard code the urls, so you can reference them with the :ttag:`url` template tag:: |
