summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Smith <smithdc@gmail.com>2021-10-18 17:06:00 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-10-19 06:33:00 +0200
commit6aa917383faaa80e70c6a8a8bc0f52f088434a84 (patch)
tree266a920665a19e685cd1809e276b234f444e0b39
parentc067a2b68fe2701608b34ac4a538e1f9dba0e9f2 (diff)
[4.0.x] Refs #32956 -- Changed docs to treat the acronym HTTP phonetically.
Backport of 69b0736fad1d1f0197409ca025b7bcdf5666ae62 from main
-rw-r--r--django/core/handlers/asgi.py2
-rw-r--r--django/shortcuts.py6
-rw-r--r--django/test/client.py2
-rw-r--r--docs/internals/contributing/writing-documentation.txt3
-rw-r--r--docs/ref/class-based-views/base.txt4
-rw-r--r--docs/ref/exceptions.txt2
-rw-r--r--docs/ref/settings.txt2
-rw-r--r--docs/releases/1.3.txt2
-rw-r--r--docs/topics/class-based-views/mixins.txt2
-rw-r--r--docs/topics/testing/tools.txt2
-rw-r--r--tests/generic_views/test_base.py5
-rw-r--r--tests/get_object_or_404/tests.py6
-rw-r--r--tests/servers/tests.py2
13 files changed, 22 insertions, 18 deletions
diff --git a/django/core/handlers/asgi.py b/django/core/handlers/asgi.py
index 2b8cc8b76e..9d84efc964 100644
--- a/django/core/handlers/asgi.py
+++ b/django/core/handlers/asgi.py
@@ -176,7 +176,7 @@ class ASGIHandler(base.BaseHandler):
await self.send_response(response, send)
async def read_body(self, receive):
- """Reads a HTTP body from an ASGI connection."""
+ """Reads an HTTP body from an ASGI connection."""
# Use the tempfile that auto rolls-over to a disk file as it fills up.
body_file = tempfile.SpooledTemporaryFile(max_size=settings.FILE_UPLOAD_MAX_MEMORY_SIZE, mode='w+b')
while True:
diff --git a/django/shortcuts.py b/django/shortcuts.py
index d810471640..9d213bc1ff 100644
--- a/django/shortcuts.py
+++ b/django/shortcuts.py
@@ -13,7 +13,7 @@ from django.utils.functional import Promise
def render(request, template_name, context=None, content_type=None, status=None, using=None):
"""
- Return a HttpResponse whose content is filled with the result of calling
+ Return an HttpResponse whose content is filled with the result of calling
django.template.loader.render_to_string() with the passed arguments.
"""
content = loader.render_to_string(template_name, context, request, using=using)
@@ -56,7 +56,7 @@ def _get_queryset(klass):
def get_object_or_404(klass, *args, **kwargs):
"""
- Use get() to return an object, or raise a Http404 exception if the object
+ Use get() to return an object, or raise an Http404 exception if the object
does not exist.
klass may be a Model, Manager, or QuerySet object. All other passed
@@ -80,7 +80,7 @@ def get_object_or_404(klass, *args, **kwargs):
def get_list_or_404(klass, *args, **kwargs):
"""
- Use filter() to return a list of objects, or raise a Http404 exception if
+ Use filter() to return a list of objects, or raise an Http404 exception if
the list is empty.
klass may be a Model, Manager, or QuerySet object. All other passed
diff --git a/django/test/client.py b/django/test/client.py
index c65e07ce7e..560f994876 100644
--- a/django/test/client.py
+++ b/django/test/client.py
@@ -117,7 +117,7 @@ def conditional_content_removal(request, response):
class ClientHandler(BaseHandler):
"""
- A HTTP Handler that can be used for testing purposes. Use the WSGI
+ An HTTP Handler that can be used for testing purposes. Use the WSGI
interface to compose requests, but return the raw HttpResponse object with
the originating WSGIRequest attached to its ``wsgi_request`` attribute.
"""
diff --git a/docs/internals/contributing/writing-documentation.txt b/docs/internals/contributing/writing-documentation.txt
index e409b7fcc7..9ea20d0095 100644
--- a/docs/internals/contributing/writing-documentation.txt
+++ b/docs/internals/contributing/writing-documentation.txt
@@ -146,6 +146,9 @@ documentation:
* **email** -- no hyphen.
+* **HTTP** -- the expected pronunciation is "Aitch Tee Tee Pee" and therefore
+ should be preceded by "an" and not "a".
+
* **MySQL**, **PostgreSQL**, **SQLite**
* **SQL** -- when referring to SQL, the expected pronunciation should be
diff --git a/docs/ref/class-based-views/base.txt b/docs/ref/class-based-views/base.txt
index e64fc03555..324a28fcd3 100644
--- a/docs/ref/class-based-views/base.txt
+++ b/docs/ref/class-based-views/base.txt
@@ -86,7 +86,7 @@ MRO is an acronym for Method Resolution Order.
.. method:: dispatch(request, *args, **kwargs)
The ``view`` part of the view -- the method that accepts a ``request``
- argument plus arguments, and returns a HTTP response.
+ argument plus arguments, and returns an HTTP response.
The default implementation will inspect the HTTP method and attempt to
delegate to a method that matches the HTTP method; a ``GET`` will be
@@ -99,7 +99,7 @@ MRO is an acronym for Method Resolution Order.
.. method:: http_method_not_allowed(request, *args, **kwargs)
- If the view was called with a HTTP method it doesn't support, this
+ If the view was called with an HTTP method it doesn't support, this
method is called instead.
The default implementation returns ``HttpResponseNotAllowed`` with a
diff --git a/docs/ref/exceptions.txt b/docs/ref/exceptions.txt
index 2f5aa64b9d..1b22368e77 100644
--- a/docs/ref/exceptions.txt
+++ b/docs/ref/exceptions.txt
@@ -179,7 +179,7 @@ list of errors.
.. exception:: RequestAborted
- The :exc:`RequestAborted` exception is raised when a HTTP body being read
+ The :exc:`RequestAborted` exception is raised when an HTTP body being read
in by the handler is cut off midstream and the client connection closes,
or when the client does not send data and hits a timeout where the server
closes the connection.
diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt
index a272bdbcb3..66798b6b96 100644
--- a/docs/ref/settings.txt
+++ b/docs/ref/settings.txt
@@ -2349,7 +2349,7 @@ already have it.
Default: ``None``
-A tuple representing a HTTP header/value combination that signifies a request
+A tuple representing an HTTP header/value combination that signifies a request
is secure. This controls the behavior of the request object's ``is_secure()``
method.
diff --git a/docs/releases/1.3.txt b/docs/releases/1.3.txt
index 3d381ca8ac..6bc723ec02 100644
--- a/docs/releases/1.3.txt
+++ b/docs/releases/1.3.txt
@@ -81,7 +81,7 @@ Django 1.3 adds framework-level support for Python's ``logging``
module. This means you can now easily configure and control logging
as part of your Django project. A number of logging handlers and
logging calls have been added to Django's own code as well -- most
-notably, the error emails sent on a HTTP 500 server error are now
+notably, the error emails sent on an HTTP 500 server error are now
handled as a logging activity. See :doc:`the documentation on Django's
logging interface </topics/logging>` for more details.
diff --git a/docs/topics/class-based-views/mixins.txt b/docs/topics/class-based-views/mixins.txt
index 7b193ea7f0..08a1ec1af9 100644
--- a/docs/topics/class-based-views/mixins.txt
+++ b/docs/topics/class-based-views/mixins.txt
@@ -653,7 +653,7 @@ same behavior -- except for the format of the response.
If you want to be really adventurous, you could even mix a
:class:`~django.views.generic.detail.DetailView` subclass that is able
to return *both* HTML and JSON content, depending on some property of
-the HTTP request, such as a query argument or a HTTP header. Mix in both the
+the HTTP request, such as a query argument or an HTTP header. Mix in both the
``JSONResponseMixin`` and a
:class:`~django.views.generic.detail.SingleObjectTemplateResponseMixin`,
and override the implementation of
diff --git a/docs/topics/testing/tools.txt b/docs/topics/testing/tools.txt
index 25dcf4ad54..b06fabcc66 100644
--- a/docs/topics/testing/tools.txt
+++ b/docs/topics/testing/tools.txt
@@ -717,7 +717,7 @@ A subclass of :class:`unittest.TestCase` that adds this functionality:
* Verifying that a template :meth:`has/hasn't been used to generate a given
response content <SimpleTestCase.assertTemplateUsed>`.
* Verifying that two :meth:`URLs <SimpleTestCase.assertURLEqual>` are equal.
- * Verifying a HTTP :meth:`redirect <SimpleTestCase.assertRedirects>` is
+ * Verifying an HTTP :meth:`redirect <SimpleTestCase.assertRedirects>` is
performed by the app.
* Robustly testing two :meth:`HTML fragments <SimpleTestCase.assertHTMLEqual>`
for equality/inequality or :meth:`containment <SimpleTestCase.assertInHTML>`.
diff --git a/tests/generic_views/test_base.py b/tests/generic_views/test_base.py
index 5872ecf3db..661b9941ea 100644
--- a/tests/generic_views/test_base.py
+++ b/tests/generic_views/test_base.py
@@ -89,7 +89,8 @@ class ViewTest(SimpleTestCase):
def test_pathological_http_method(self):
"""
- The edge case of a http request that spoofs an existing method name is caught.
+ The edge case of an http request that spoofs an existing method name is
+ caught.
"""
self.assertEqual(SimpleView.as_view()(
self.rf.get('/', REQUEST_METHOD='DISPATCH')
@@ -140,7 +141,7 @@ class ViewTest(SimpleTestCase):
def test_invalid_keyword_argument(self):
"""
View arguments must be predefined on the class and can't
- be named like a HTTP method.
+ be named like an HTTP method.
"""
msg = (
'The method name %s is not accepted as a keyword argument to '
diff --git a/tests/get_object_or_404/tests.py b/tests/get_object_or_404/tests.py
index 075f9a08e1..71815d34ef 100644
--- a/tests/get_object_or_404/tests.py
+++ b/tests/get_object_or_404/tests.py
@@ -10,7 +10,7 @@ class GetObjectOr404Tests(TestCase):
a1 = Author.objects.create(name="Brave Sir Robin")
a2 = Author.objects.create(name="Patsy")
- # No Articles yet, so we should get a Http404 error.
+ # No Articles yet, so we should get an Http404 error.
with self.assertRaises(Http404):
get_object_or_404(Article, title="Foo")
@@ -28,7 +28,7 @@ class GetObjectOr404Tests(TestCase):
article
)
- # No articles containing "Camelot". This should raise a Http404 error.
+ # No articles containing "Camelot". This should raise an Http404 error.
with self.assertRaises(Http404):
get_object_or_404(a1.article_set, title__contains="Camelot")
@@ -50,7 +50,7 @@ class GetObjectOr404Tests(TestCase):
with self.assertRaises(Author.MultipleObjectsReturned):
get_object_or_404(Author.objects.all())
- # Using an empty QuerySet raises a Http404 error.
+ # Using an empty QuerySet raises an Http404 error.
with self.assertRaises(Http404):
get_object_or_404(Article.objects.none(), title__contains="Run")
diff --git a/tests/servers/tests.py b/tests/servers/tests.py
index c4b8298fd8..8f21f85918 100644
--- a/tests/servers/tests.py
+++ b/tests/servers/tests.py
@@ -173,7 +173,7 @@ class LiveServerViews(LiveServerBase):
def test_closes_connection_without_content_length(self):
"""
- A HTTP 1.1 server is supposed to support keep-alive. Since our
+ An HTTP 1.1 server is supposed to support keep-alive. Since our
development server is rather simple we support it only in cases where
we can detect a content length from the response. This should be doable
for all simple views and streaming responses where an iterable with