aboutsummaryrefslogtreecommitdiffstats
path: root/djangorestframework/parsers.py
diff options
context:
space:
mode:
authorJens Alm2011-07-02 18:38:55 +0200
committerJens Alm2011-07-02 18:38:55 +0200
commit7ee1bbecc652ed3237182399bd644c1d42dff2db (patch)
tree2677bfcab7222f62ad6b2bd5756828bc9bfac03e /djangorestframework/parsers.py
parent83b47c4b766273f0691c0a81a373237867de75af (diff)
downloaddjango-rest-framework-7ee1bbecc652ed3237182399bd644c1d42dff2db.tar.bz2
Set default renderers for views when yaml is not installed
Will use the renderer.DEFAULT_RENDERERS dict for determining available renderers in views.View to avoid a nonexistent renderer when yaml is not installed. Duplicates the behavior in parsers.DEFAULT_PARSERS
Diffstat (limited to 'djangorestframework/parsers.py')
-rw-r--r--djangorestframework/parsers.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py
index 5f19c521..cfe8ec9e 100644
--- a/djangorestframework/parsers.py
+++ b/djangorestframework/parsers.py
@@ -167,3 +167,9 @@ class MultiPartParser(BaseParser):
{'detail': 'multipart parse error - %s' % unicode(exc)})
return django_parser.parse()
+DEFAULT_PARSERS = ( JSONParser,
+ FormParser,
+ MultiPartParser )
+
+if YAMLParser:
+ DEFAULT_PARSERS += (YAMLParser,) \ No newline at end of file