mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 03:23:59 +03:00
commit
f43f20bd3a
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -21,3 +21,4 @@ MANIFEST
|
|||
.coverage
|
||||
.tox
|
||||
.DS_Store
|
||||
.idea/*
|
|
@ -108,7 +108,8 @@ if yaml:
|
|||
except ValueError, exc:
|
||||
raise ErrorResponse(status.HTTP_400_BAD_REQUEST,
|
||||
{'detail': 'YAML parse error - %s' % unicode(exc)})
|
||||
|
||||
else:
|
||||
YAMLParser = None
|
||||
|
||||
class PlainTextParser(BaseParser):
|
||||
"""
|
||||
|
@ -167,3 +168,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,)
|
||||
|
|
|
@ -44,9 +44,7 @@ class View(ResourceMixin, RequestMixin, ResponseMixin, AuthMixin, DjangoView):
|
|||
"""
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue
Block a user