aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Christie2014-12-28 12:14:07 +0000
committerTom Christie2014-12-28 12:14:07 +0000
commitd8e66970a11ec2d4b66f0cf56950f2cc83e83224 (patch)
treed3318a67d8c7fcbfb81c60472b7bc58bad3940dc
parentefa5942ce1c5d2286fd91994b52fb73a5690426c (diff)
downloaddjango-rest-framework-d8e66970a11ec2d4b66f0cf56950f2cc83e83224.tar.bz2
Note on using i18n_patterns with format_suffix_patterns. Closes #2278.
-rw-r--r--docs/api-guide/format-suffixes.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/docs/api-guide/format-suffixes.md b/docs/api-guide/format-suffixes.md
index 20c1e995..35dbcd39 100644
--- a/docs/api-guide/format-suffixes.md
+++ b/docs/api-guide/format-suffixes.md
@@ -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