summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2022-05-05 15:23:54 -0400
committerCarlton Gibson <carlton@noumenal.es>2022-05-17 09:51:16 +0200
commit2a5d2eefc751be012fdebd75d8177c42bf5a76fc (patch)
tree26d3acbe663139679e8c4460f331c83666697871
parent97f124f39e363bf518fbe428320bdee63d56f8e0 (diff)
Fixed #33683 -- Document HttpResponseBase and allow import from django.http
-rw-r--r--django/http/__init__.py2
-rw-r--r--docs/ref/request-response.txt12
2 files changed, 14 insertions, 0 deletions
diff --git a/django/http/__init__.py b/django/http/__init__.py
index 4c997154d9..87109059a3 100644
--- a/django/http/__init__.py
+++ b/django/http/__init__.py
@@ -11,6 +11,7 @@ from django.http.response import (
Http404,
HttpResponse,
HttpResponseBadRequest,
+ HttpResponseBase,
HttpResponseForbidden,
HttpResponseGone,
HttpResponseNotAllowed,
@@ -31,6 +32,7 @@ __all__ = [
"RawPostDataException",
"UnreadablePostError",
"HttpResponse",
+ "HttpResponseBase",
"StreamingHttpResponse",
"HttpResponseRedirect",
"HttpResponsePermanentRedirect",
diff --git a/docs/ref/request-response.txt b/docs/ref/request-response.txt
index 3a3c4d14fc..81558c8916 100644
--- a/docs/ref/request-response.txt
+++ b/docs/ref/request-response.txt
@@ -1150,6 +1150,9 @@ the data to the client. Because the content can't be accessed, many
middleware can't function normally. For example the ``ETag`` and
``Content-Length`` headers can't be generated for streaming responses.
+The :class:`HttpResponseBase` base class is common between
+:class:`HttpResponse` and :class:`StreamingHttpResponse`.
+
Attributes
----------
@@ -1218,3 +1221,12 @@ Methods
This method is automatically called during the response initialization and
set various headers (``Content-Length``, ``Content-Type``, and
``Content-Disposition``) depending on ``open_file``.
+
+``HttpResponseBase`` class
+==========================
+
+.. class:: HttpResponseBase
+
+The :class:`HttpResponseBase` class is common to all Django responses.
+It should not be used to create responses directly, but it can be
+useful for type-checking.