diff options
| author | Jens Alm | 2011-07-02 18:38:55 +0200 |
|---|---|---|
| committer | Jens Alm | 2011-07-02 18:38:55 +0200 |
| commit | 7ee1bbecc652ed3237182399bd644c1d42dff2db (patch) | |
| tree | 2677bfcab7222f62ad6b2bd5756828bc9bfac03e /djangorestframework/parsers.py | |
| parent | 83b47c4b766273f0691c0a81a373237867de75af (diff) | |
| download | django-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.py | 6 |
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 |
