From 7ee1bbecc652ed3237182399bd644c1d42dff2db Mon Sep 17 00:00:00 2001 From: Jens Alm Date: Sat, 2 Jul 2011 18:38:55 +0200 Subject: 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 --- djangorestframework/parsers.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'djangorestframework/parsers.py') 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 -- cgit v1.2.3