From d8dbd8679080035de4e785a8e7b998fb01f4052b Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Sat, 10 Jan 2015 10:41:12 +0100 Subject: Update documentation --- api-guide/format-suffixes/index.html | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'api-guide/format-suffixes/index.html') diff --git a/api-guide/format-suffixes/index.html b/api-guide/format-suffixes/index.html index 22181b1b..d7d74db9 100644 --- a/api-guide/format-suffixes/index.html +++ b/api-guide/format-suffixes/index.html @@ -428,6 +428,16 @@ def comment_list(request, format=None):

The name of the kwarg used may be modified by using the FORMAT_SUFFIX_KWARG setting.

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

There seems to be a view among some of the Web community that filename extensions are not a RESTful pattern, and that HTTP Accept headers should always be used instead.

-- cgit v1.2.3