diff --git a/djangorestframework/parsers.py b/djangorestframework/parsers.py index 5f19c521b..cfe8ec9ed 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 diff --git a/djangorestframework/views.py b/djangorestframework/views.py index 757d89db4..aedc7427b 100644 --- a/djangorestframework/views.py +++ b/djangorestframework/views.py @@ -40,20 +40,12 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView): """ List of renderers the resource can serialize the response with, ordered by preference. """ - renderers = ( renderers.JSONRenderer, - renderers.DocumentingHTMLRenderer, - renderers.DocumentingXHTMLRenderer, - renderers.DocumentingPlainTextRenderer, - renderers.XMLRenderer, - renderers.YAMLRenderer ) + renderers = renderers.DEFAULT_RENDERERS """ List of parsers the resource can parse the request with. """ - parsers = ( parsers.JSONParser, - parsers.FormParser, - parsers.MultiPartParser ) - + parsers = parsers.DEFAULT_PARSERS """ List of all authenticating methods to attempt. """