Note on using i18n_patterns with format_suffix_patterns. Closes #2278.

This commit is contained in:
Tom Christie 2014-12-28 12:14:07 +00:00
parent efa5942ce1
commit d8e66970a1
1 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,18 @@ The name of the kwarg used may be modified by using the `FORMAT_SUFFIX_KWARG` se
Also note that `format_suffix_patterns` does not support descending into `include` URL patterns.
### Using with `i18n_patterns`
If using the `i18n_patterns` function provided by Django, as well as `format_suffix_patterns` you should make sure that the `i18n_patterns` function is applied as the final, or outermost function. For example:
url patterns = [
]
urlpatterns = i18n_patterns(
format_suffix_patterns(urlpatterns, allowed=['json', 'html'])
)
---
## Accept headers vs. format suffixes