aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/views.py
diff options
context:
space:
mode:
authorPhilip Douglas2013-07-04 05:29:42 -0700
committerPhilip Douglas2013-07-04 05:29:42 -0700
commitbf8e71c455a47a53898f8239ac7dad47e5f1d53a (patch)
tree967055f41f43a35b8d9362f47c81aad5af4036d3 /rest_framework/views.py
parentfa9f5fb8dcf6d51b2db70d4e2a991779b056d1d4 (diff)
parent5fa100245cbf71a47c7a1ea7a869d03049380130 (diff)
downloaddjango-rest-framework-bf8e71c455a47a53898f8239ac7dad47e5f1d53a.tar.bz2
Merge pull request #1 from tomchristie/master
Update from main
Diffstat (limited to 'rest_framework/views.py')
-rw-r--r--rest_framework/views.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/rest_framework/views.py b/rest_framework/views.py
index c28d2835..37bba7f0 100644
--- a/rest_framework/views.py
+++ b/rest_framework/views.py
@@ -4,11 +4,11 @@ Provides an APIView class that is the base of all views in REST framework.
from __future__ import unicode_literals
from django.core.exceptions import PermissionDenied
-from django.http import Http404, HttpResponse
+from django.http import Http404
from django.utils.datastructures import SortedDict
from django.views.decorators.csrf import csrf_exempt
from rest_framework import status, exceptions
-from rest_framework.compat import View
+from rest_framework.compat import View, HttpResponseBase
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.settings import api_settings
@@ -244,9 +244,10 @@ class APIView(View):
Returns the final response object.
"""
# Make the error obvious if a proper response is not returned
- assert isinstance(response, HttpResponse), (
- 'Expected a `Response` to be returned from the view, '
- 'but received a `%s`' % type(response)
+ assert isinstance(response, HttpResponseBase), (
+ 'Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` '
+ 'to be returned from the view, but received a `%s`'
+ % type(response)
)
if isinstance(response, Response):