mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-03 13:14:30 +03:00
Merge pull request #2764 from jpadilla/2763
Use default reason phrases from HTTP standard. Fixes #2763
This commit is contained in:
commit
aa131ae258
|
@ -5,7 +5,7 @@ it is initialized with unrendered data, instead of a pre-rendered string.
|
||||||
The appropriate renderer is called during Django's template response rendering.
|
The appropriate renderer is called during Django's template response rendering.
|
||||||
"""
|
"""
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
from django.core.handlers.wsgi import STATUS_CODE_TEXT
|
from django.utils.six.moves.http_client import responses
|
||||||
from django.template.response import SimpleTemplateResponse
|
from django.template.response import SimpleTemplateResponse
|
||||||
from django.utils import six
|
from django.utils import six
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class Response(SimpleTemplateResponse):
|
||||||
"""
|
"""
|
||||||
# TODO: Deprecate and use a template tag instead
|
# TODO: Deprecate and use a template tag instead
|
||||||
# TODO: Status code text for RFC 6585 status codes
|
# TODO: Status code text for RFC 6585 status codes
|
||||||
return STATUS_CODE_TEXT.get(self.status_code, '')
|
return responses.get(self.status_code, '')
|
||||||
|
|
||||||
def __getstate__(self):
|
def __getstate__(self):
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Reference in New Issue
Block a user