summaryrefslogtreecommitdiff
path: root/django
diff options
context:
space:
mode:
authorSarah Boyce <42296566+sarahboyce@users.noreply.github.com>2025-07-18 15:37:14 +0200
committernessita <124304+nessita@users.noreply.github.com>2025-07-23 10:09:43 -0300
commit1ecf6889cabc9f3f60d3fdd651468cddd8f4da6e (patch)
tree77eebf89eaf5f1ee6f5947a962caa67b5cca7f4b /django
parent1909108f9f0f2a91c1ec0fcdb65b01f58743a871 (diff)
Removed double spaces after periods and within phrases.
Diffstat (limited to 'django')
-rw-r--r--django/conf/global_settings.py7
-rw-r--r--django/contrib/admin/checks.py2
-rw-r--r--django/contrib/admin/options.py6
-rw-r--r--django/contrib/admin/tests.py2
-rw-r--r--django/contrib/admindocs/utils.py2
-rw-r--r--django/contrib/auth/backends.py4
-rw-r--r--django/contrib/auth/hashers.py6
-rw-r--r--django/contrib/auth/management/__init__.py2
-rw-r--r--django/contrib/auth/middleware.py8
-rw-r--r--django/contrib/gis/db/backends/base/operations.py2
-rw-r--r--django/contrib/gis/db/backends/oracle/models.py2
-rw-r--r--django/contrib/gis/db/backends/oracle/operations.py4
-rw-r--r--django/contrib/gis/db/backends/postgis/introspection.py2
-rw-r--r--django/contrib/gis/db/backends/postgis/operations.py6
-rw-r--r--django/contrib/gis/db/models/fields.py12
-rw-r--r--django/contrib/gis/feeds.py2
-rw-r--r--django/contrib/gis/forms/fields.py4
-rw-r--r--django/contrib/gis/gdal/__init__.py2
-rw-r--r--django/contrib/gis/gdal/datasource.py2
-rw-r--r--django/contrib/gis/gdal/envelope.py8
-rw-r--r--django/contrib/gis/gdal/feature.py6
-rw-r--r--django/contrib/gis/gdal/field.py2
-rw-r--r--django/contrib/gis/gdal/geometries.py4
-rw-r--r--django/contrib/gis/gdal/layer.py10
-rw-r--r--django/contrib/gis/gdal/libgdal.py4
-rw-r--r--django/contrib/gis/gdal/prototypes/errcheck.py6
-rw-r--r--django/contrib/gis/gdal/srs.py4
-rw-r--r--django/contrib/gis/geoip2.py2
-rw-r--r--django/contrib/gis/geometry.py2
-rw-r--r--django/contrib/gis/geos/__init__.py2
-rw-r--r--django/contrib/gis/geos/geometry.py2
-rw-r--r--django/contrib/gis/geos/io.py2
-rw-r--r--django/contrib/gis/geos/libgeos.py6
-rw-r--r--django/contrib/gis/geos/linestring.py2
-rw-r--r--django/contrib/gis/geos/polygon.py2
-rw-r--r--django/contrib/gis/geos/prototypes/geom.py2
-rw-r--r--django/contrib/gis/geos/prototypes/io.py4
-rw-r--r--django/contrib/gis/sitemaps/views.py2
-rw-r--r--django/contrib/gis/utils/layermapping.py14
-rw-r--r--django/contrib/gis/utils/ogrinspect.py18
-rw-r--r--django/contrib/gis/utils/srs.py2
-rw-r--r--django/contrib/sessions/backends/file.py6
-rw-r--r--django/core/cache/__init__.py2
-rw-r--r--django/core/cache/backends/base.py2
-rw-r--r--django/core/files/images.py2
-rw-r--r--django/core/files/move.py2
-rw-r--r--django/core/files/utils.py2
-rw-r--r--django/core/management/base.py2
-rw-r--r--django/core/management/commands/makemessages.py2
-rw-r--r--django/core/serializers/__init__.py2
-rw-r--r--django/db/backends/oracle/base.py6
-rw-r--r--django/db/backends/oracle/operations.py2
-rw-r--r--django/db/models/deletion.py6
-rw-r--r--django/db/models/fields/files.py12
-rw-r--r--django/db/models/query.py2
-rw-r--r--django/http/request.py2
-rw-r--r--django/middleware/csrf.py4
-rw-r--r--django/template/defaulttags.py6
-rw-r--r--django/template/library.py2
-rw-r--r--django/template/smartif.py4
-rw-r--r--django/templatetags/cache.py2
-rw-r--r--django/test/client.py2
-rw-r--r--django/utils/archive.py2
-rw-r--r--django/utils/crypto.py2
-rw-r--r--django/utils/timesince.py2
-rw-r--r--django/views/decorators/csrf.py2
-rw-r--r--django/views/decorators/http.py2
-rw-r--r--django/views/generic/edit.py2
-rw-r--r--django/views/static.py4
69 files changed, 135 insertions, 136 deletions
diff --git a/django/conf/global_settings.py b/django/conf/global_settings.py
index bd758bfcc4..25ac49becf 100644
--- a/django/conf/global_settings.py
+++ b/django/conf/global_settings.py
@@ -223,7 +223,7 @@ FORM_RENDERER = "django.forms.renderers.DjangoTemplates"
DEFAULT_FROM_EMAIL = "webmaster@localhost"
# Subject-line prefix for email messages send with django.core.mail.mail_admins
-# or ...mail_managers. Make sure to include the trailing space.
+# or ...mail_managers. Make sure to include the trailing space.
EMAIL_SUBJECT_PREFIX = "[Django] "
# Whether to append trailing slashes to URLs.
@@ -533,9 +533,8 @@ LOGOUT_REDIRECT_URL = None
# The number of seconds a password reset link is valid for (default: 3 days).
PASSWORD_RESET_TIMEOUT = 60 * 60 * 24 * 3
-# the first hasher in this list is the preferred algorithm. any
-# password using different algorithms will be converted automatically
-# upon login
+# The first hasher in this list is the preferred algorithm. Any password using
+# different algorithms will be converted automatically upon login.
PASSWORD_HASHERS = [
"django.contrib.auth.hashers.PBKDF2PasswordHasher",
"django.contrib.auth.hashers.PBKDF2SHA1PasswordHasher",
diff --git a/django/contrib/admin/checks.py b/django/contrib/admin/checks.py
index 4bfbe25f22..0b3d3f159a 100644
--- a/django/contrib/admin/checks.py
+++ b/django/contrib/admin/checks.py
@@ -1026,7 +1026,7 @@ class ModelAdminChecks(BaseModelAdminChecks):
return must_inherit_from(
parent="ListFilter", option=label, obj=obj, id="admin.E113"
)
- # ... but not a FieldListFilter.
+ # ... but not a FieldListFilter.
elif issubclass(item, FieldListFilter):
return [
checks.Error(
diff --git a/django/contrib/admin/options.py b/django/contrib/admin/options.py
index 1ab136062c..fc1c3f1eda 100644
--- a/django/contrib/admin/options.py
+++ b/django/contrib/admin/options.py
@@ -250,7 +250,7 @@ class BaseModelAdmin(metaclass=forms.MediaDefiningClass):
def get_field_queryset(self, db, db_field, request):
"""
If the ModelAdmin specifies ordering, the queryset should respect that
- ordering. Otherwise don't specify the queryset, let the field decide
+ ordering. Otherwise don't specify the queryset, let the field decide
(return None in that case).
"""
try:
@@ -1047,7 +1047,7 @@ class ModelAdmin(BaseModelAdmin):
def get_action_choices(self, request, default_choices=models.BLANK_CHOICE_DASH):
"""
- Return a list of choices for use in a form object. Each choice is a
+ Return a list of choices for use in a form object. Each choice is a
tuple (name, description).
"""
choices = [*default_choices]
@@ -1059,7 +1059,7 @@ class ModelAdmin(BaseModelAdmin):
def get_action(self, action):
"""
Return a given action from a parameter, which can either be a callable,
- or the name of a method on the ModelAdmin. Return is a tuple of
+ or the name of a method on the ModelAdmin. Return is a tuple of
(callable, name, description).
"""
# If the action is a callable, just use it.
diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py
index d711f13010..98eca091ce 100644
--- a/django/contrib/admin/tests.py
+++ b/django/contrib/admin/tests.py
@@ -118,7 +118,7 @@ class AdminSeleniumTestCase(SeleniumTestCase, StaticLiveServerTestCase):
def wait_page_ready(self, timeout=10):
"""
- Block until the page is ready.
+ Block until the page is ready.
"""
self.wait_until(
lambda driver: driver.execute_script("return document.readyState;")
diff --git a/django/contrib/admindocs/utils.py b/django/contrib/admindocs/utils.py
index 5b28a8d2c6..c119a1a9ad 100644
--- a/django/contrib/admindocs/utils.py
+++ b/django/contrib/admindocs/utils.py
@@ -30,7 +30,7 @@ def get_view_name(view_func):
def parse_docstring(docstring):
"""
- Parse out the parts of a docstring. Return (title, body, metadata).
+ Parse out the parts of a docstring. Return (title, body, metadata).
"""
if not docstring:
return "", "", {}
diff --git a/django/contrib/auth/backends.py b/django/contrib/auth/backends.py
index 8352530665..e72a18981c 100644
--- a/django/contrib/auth/backends.py
+++ b/django/contrib/auth/backends.py
@@ -254,7 +254,7 @@ class RemoteUserBackend(ModelBackend):
is handling authentication outside of Django.
By default, the ``authenticate`` method creates ``User`` objects for
- usernames that don't already exist in the database. Subclasses can disable
+ usernames that don't already exist in the database. Subclasses can disable
this behavior by setting the ``create_unknown_user`` attribute to
``False``.
"""
@@ -318,7 +318,7 @@ class RemoteUserBackend(ModelBackend):
def clean_username(self, username):
"""
Perform any cleaning on the "username" prior to using it to get or
- create the user object. Return the cleaned username.
+ create the user object. Return the cleaned username.
By default, return the username unchanged.
"""
diff --git a/django/contrib/auth/hashers.py b/django/contrib/auth/hashers.py
index aa183c3904..29eb1f1b77 100644
--- a/django/contrib/auth/hashers.py
+++ b/django/contrib/auth/hashers.py
@@ -314,7 +314,7 @@ class PBKDF2PasswordHasher(BasePasswordHasher):
Secure password hashing using the PBKDF2 algorithm (recommended)
Configured to use PBKDF2 + HMAC + SHA256.
- The result is a 64 byte binary string. Iterations may be changed
+ The result is a 64 byte binary string. Iterations may be changed
safely but you must rename the algorithm if you change SHA256.
"""
@@ -486,7 +486,7 @@ class BCryptSHA256PasswordHasher(BasePasswordHasher):
Secure password hashing using the bcrypt algorithm (recommended)
This is considered by many to be the most secure algorithm but you
- must first install the bcrypt library. Please be warned that
+ must first install the bcrypt library. Please be warned that
this library depends on native C code and might cause portability
issues.
"""
@@ -559,7 +559,7 @@ class BCryptPasswordHasher(BCryptSHA256PasswordHasher):
Secure password hashing using the bcrypt algorithm
This is considered by many to be the most secure algorithm but you
- must first install the bcrypt library. Please be warned that
+ must first install the bcrypt library. Please be warned that
this library depends on native C code and might cause portability
issues.
diff --git a/django/contrib/auth/management/__init__.py b/django/contrib/auth/management/__init__.py
index a8639cb258..e816357b2b 100644
--- a/django/contrib/auth/management/__init__.py
+++ b/django/contrib/auth/management/__init__.py
@@ -80,7 +80,7 @@ def create_permissions(
)
# Find all the Permissions that have a content_type for a model we're
- # looking for. We don't need to check for codenames since we already have
+ # looking for. We don't need to check for codenames since we already have
# a list of the ones we're going to create.
all_perms = set(
Permission.objects.using(using)
diff --git a/django/contrib/auth/middleware.py b/django/contrib/auth/middleware.py
index 6be3552cad..297a8a83b2 100644
--- a/django/contrib/auth/middleware.py
+++ b/django/contrib/auth/middleware.py
@@ -137,7 +137,7 @@ class RemoteUserMiddleware:
if not hasattr(request, "user"):
raise ImproperlyConfigured(
"The Django remote user auth middleware requires the"
- " authentication middleware to be installed. Edit your"
+ " authentication middleware to be installed. Edit your"
" MIDDLEWARE setting to insert"
" 'django.contrib.auth.middleware.AuthenticationMiddleware'"
" before the RemoteUserMiddleware class."
@@ -166,7 +166,7 @@ class RemoteUserMiddleware:
# to authenticate the user.
user = auth.authenticate(request, remote_user=username)
if user:
- # User is valid. Set request.user and persist user in the session
+ # User is valid. Set request.user and persist user in the session
# by logging the user in.
request.user = user
auth.login(request, user)
@@ -194,7 +194,7 @@ class RemoteUserMiddleware:
if not hasattr(request, "user"):
raise ImproperlyConfigured(
"The Django remote user auth middleware requires the"
- " authentication middleware to be installed. Edit your"
+ " authentication middleware to be installed. Edit your"
" MIDDLEWARE setting to insert"
" 'django.contrib.auth.middleware.AuthenticationMiddleware'"
" before the RemoteUserMiddleware class."
@@ -226,7 +226,7 @@ class RemoteUserMiddleware:
# to authenticate the user.
user = await auth.aauthenticate(request, remote_user=username)
if user:
- # User is valid. Set request.user and persist user in the session
+ # User is valid. Set request.user and persist user in the session
# by logging the user in.
request.user = user
await auth.alogin(request, user)
diff --git a/django/contrib/gis/db/backends/base/operations.py b/django/contrib/gis/db/backends/base/operations.py
index 23e7fd2c25..5c09aaa8bc 100644
--- a/django/contrib/gis/db/backends/base/operations.py
+++ b/django/contrib/gis/db/backends/base/operations.py
@@ -117,7 +117,7 @@ class BaseSpatialOperations:
def get_geom_placeholder(self, f, value, compiler):
"""
Return the placeholder for the given geometry field with the given
- value. Depending on the spatial backend, the placeholder may contain a
+ value. Depending on the spatial backend, the placeholder may contain a
stored procedure call to the transformation function of the spatial
backend.
"""
diff --git a/django/contrib/gis/db/backends/oracle/models.py b/django/contrib/gis/db/backends/oracle/models.py
index 7a69fbc4d0..b5fc7bf7de 100644
--- a/django/contrib/gis/db/backends/oracle/models.py
+++ b/django/contrib/gis/db/backends/oracle/models.py
@@ -54,7 +54,7 @@ class OracleSpatialRefSys(models.Model, SpatialRefSysMixin):
auth_name = models.CharField(max_length=256)
wktext = models.CharField(max_length=2046)
# Optional geometry representing the bounds of this coordinate
- # system. By default, all are NULL in the table.
+ # system. By default, all are NULL in the table.
cs_bounds = models.PolygonField(null=True)
class Meta:
diff --git a/django/contrib/gis/db/backends/oracle/operations.py b/django/contrib/gis/db/backends/oracle/operations.py
index 3d5dcc7294..77cb8e034c 100644
--- a/django/contrib/gis/db/backends/oracle/operations.py
+++ b/django/contrib/gis/db/backends/oracle/operations.py
@@ -3,7 +3,7 @@ This module contains the spatial lookup types, and the `get_geo_where_clause`
routine for Oracle Spatial.
Please note that WKT support is broken on the XE version, and thus
-this backend will not work on such platforms. Specifically, XE lacks
+this backend will not work on such platforms. Specifically, XE lacks
support for an internal JVM, and Java libraries are required to use
the WKT constructors.
"""
@@ -95,7 +95,7 @@ class OracleOperations(BaseSpatialOperations, DatabaseOperations):
# We want to get SDO Geometries as WKT because it is much easier to
# instantiate GEOS proxies from WKT than SDO_GEOMETRY(...) strings.
# However, this adversely affects performance (i.e., Java is called
- # to convert to WKT on every query). If someone wishes to write a
+ # to convert to WKT on every query). If someone wishes to write a
# SDO_GEOMETRY(...) parser in Python, let me know =)
select = "SDO_UTIL.TO_WKBGEOMETRY(%s)"
diff --git a/django/contrib/gis/db/backends/postgis/introspection.py b/django/contrib/gis/db/backends/postgis/introspection.py
index c448bc37a2..7c96c2cb04 100644
--- a/django/contrib/gis/db/backends/postgis/introspection.py
+++ b/django/contrib/gis/db/backends/postgis/introspection.py
@@ -37,7 +37,7 @@ class PostGISIntrospection(DatabaseIntrospection):
"""
The geometry type OID used by PostGIS does not indicate the particular
type of field that a geometry column is (e.g., whether it's a
- PointField or a PolygonField). Thus, this routine queries the PostGIS
+ PointField or a PolygonField). Thus, this routine queries the PostGIS
metadata tables to determine the geometry type.
"""
with self.connection.cursor() as cursor:
diff --git a/django/contrib/gis/db/backends/postgis/operations.py b/django/contrib/gis/db/backends/postgis/operations.py
index bd1e79a6d6..303e039958 100644
--- a/django/contrib/gis/db/backends/postgis/operations.py
+++ b/django/contrib/gis/db/backends/postgis/operations.py
@@ -185,7 +185,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
def spatial_version(self):
"""Determine the version of the PostGIS library."""
# Trying to get the PostGIS version because the function
- # signatures will depend on the version used. The cost
+ # signatures will depend on the version used. The cost
# here is a database query to determine the version, which
# can be mitigated by setting `POSTGIS_VERSION` with a 3-tuple
# comprising user-supplied values for the major, minor, and
@@ -267,7 +267,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
This is the most complex implementation of the spatial backends due to
what is supported on geodetic geometry columns vs. what's available on
- projected geometry columns. In addition, it has to take into account
+ projected geometry columns. In addition, it has to take into account
the geography column type.
"""
# Getting the distance parameter
@@ -330,7 +330,7 @@ class PostGISOperations(BaseSpatialOperations, DatabaseOperations):
"""
Helper routine for calling PostGIS functions and returning their result.
"""
- # Close out the connection. See #9437.
+ # Close out the connection. See #9437.
with self.connection.temporary_connection() as cursor:
cursor.execute("SELECT %s()" % func)
return cursor.fetchone()[0]
diff --git a/django/contrib/gis/db/models/fields.py b/django/contrib/gis/db/models/fields.py
index 812029de49..4542e19040 100644
--- a/django/contrib/gis/db/models/fields.py
+++ b/django/contrib/gis/db/models/fields.py
@@ -33,7 +33,7 @@ def get_srid_info(srid, connection):
"""
Return the units, unit name, and spheroid WKT associated with the
given SRID from the `spatial_ref_sys` (or equivalent) spatial database
- table for the given database connection. These results are cached.
+ table for the given database connection. These results are cached.
"""
from django.contrib.gis.gdal import SpatialReference
@@ -89,7 +89,7 @@ class BaseSpatialField(Field):
Defaults to 4326 (WGS84).
spatial_index:
- Indicates whether to create a spatial index. Defaults to True.
+ Indicates whether to create a spatial index. Defaults to True.
Set this instead of 'db_index' for geographic fields since index
creation is different for geometry columns.
"""
@@ -97,7 +97,7 @@ class BaseSpatialField(Field):
# Setting the index flag with the value of the `spatial_index` keyword.
self.spatial_index = spatial_index
- # Setting the SRID and getting the units. Unit information must be
+ # Setting the SRID and getting the units. Unit information must be
# easily available in the field instance for distance queries.
self.srid = srid
@@ -251,16 +251,16 @@ class GeometryField(BaseSpatialField):
arguments:
dim:
- The number of dimensions for this geometry. Defaults to 2.
+ The number of dimensions for this geometry. Defaults to 2.
extent:
Customize the extent, in a 4-tuple of WGS 84 coordinates, for the
- geometry field entry in the `USER_SDO_GEOM_METADATA` table. Defaults
+ geometry field entry in the `USER_SDO_GEOM_METADATA` table. Defaults
to (-180.0, -90.0, 180.0, 90.0).
tolerance:
Define the tolerance, in meters, to use for the geometry field
- entry in the `USER_SDO_GEOM_METADATA` table. Defaults to 0.05.
+ entry in the `USER_SDO_GEOM_METADATA` table. Defaults to 0.05.
"""
# Setting the dimension of the geometry field.
self.dim = dim
diff --git a/django/contrib/gis/feeds.py b/django/contrib/gis/feeds.py
index ebd4511889..03a5456d42 100644
--- a/django/contrib/gis/feeds.py
+++ b/django/contrib/gis/feeds.py
@@ -35,7 +35,7 @@ class GeoFeedMixin:
geom = item.get("geometry")
if geom is not None:
if isinstance(geom, (list, tuple)):
- # Special case if a tuple/list was passed in. The tuple may be
+ # Special case if a tuple/list was passed in. The tuple may be
# a point or a box
box_coords = None
if isinstance(geom[0], (list, tuple)):
diff --git a/django/contrib/gis/forms/fields.py b/django/contrib/gis/forms/fields.py
index 1fd31530c1..3c73e12dea 100644
--- a/django/contrib/gis/forms/fields.py
+++ b/django/contrib/gis/forms/fields.py
@@ -9,8 +9,8 @@ from .widgets import OpenLayersWidget
class GeometryField(forms.Field):
"""
- This is the basic form field for a Geometry. Any textual input that is
- accepted by GEOSGeometry is accepted by this form. By default,
+ This is the basic form field for a Geometry. Any textual input that is
+ accepted by GEOSGeometry is accepted by this form. By default,
this includes WKT, HEXEWKB, WKB (in a buffer), and GeoJSON.
"""
diff --git a/django/contrib/gis/gdal/__init__.py b/django/contrib/gis/gdal/__init__.py
index 37c9273666..10da8b4189 100644
--- a/django/contrib/gis/gdal/__init__.py
+++ b/django/contrib/gis/gdal/__init__.py
@@ -1,5 +1,5 @@
"""
-This module houses ctypes interfaces for GDAL objects. The following GDAL
+This module houses ctypes interfaces for GDAL objects. The following GDAL
objects are supported:
CoordTransform: Used for coordinate transformations from one spatial
diff --git a/django/contrib/gis/gdal/datasource.py b/django/contrib/gis/gdal/datasource.py
index 2c9d47918f..5e644c142c 100644
--- a/django/contrib/gis/gdal/datasource.py
+++ b/django/contrib/gis/gdal/datasource.py
@@ -4,7 +4,7 @@ an interface for reading vector geometry data from many different file
formats (including ESRI shapefiles).
When instantiating a DataSource object, use the filename of a
-GDAL-supported data source. For example, a SHP file or a
+GDAL-supported data source. For example, an SHP file or a
TIGER/Line file from the government.
The ds_driver keyword is used internally when a ctypes pointer
diff --git a/django/contrib/gis/gdal/envelope.py b/django/contrib/gis/gdal/envelope.py
index 24383de196..8293aa499d 100644
--- a/django/contrib/gis/gdal/envelope.py
+++ b/django/contrib/gis/gdal/envelope.py
@@ -1,6 +1,6 @@
"""
The GDAL/OGR library uses an Envelope structure to hold the bounding
-box information for a geometry. The envelope (bounding box) contains
+box information for a geometry. The envelope (bounding box) contains
two pairs of coordinates, one for the lower left coordinate and one
for the upper right coordinate:
@@ -17,8 +17,8 @@ from django.contrib.gis.gdal.error import GDALException
# The OGR definition of an Envelope is a C structure containing four doubles.
-# See the 'ogr_core.h' source file for more information:
-# https://gdal.org/doxygen/ogr__core_8h_source.html
+# See the 'ogr_core.h' source file for more information:
+# https://gdal.org/doxygen/ogr__core_8h_source.html
class OGREnvelope(Structure):
"Represent the OGREnvelope C Structure."
@@ -33,7 +33,7 @@ class OGREnvelope(Structure):
class Envelope:
"""
The Envelope object is a C structure that contains the minimum and
- maximum X, Y coordinates for a rectangle bounding box. The naming
+ maximum X, Y coordinates for a rectangle bounding box. The naming
of the variables is compatible with the OGR Envelope structure.
"""
diff --git a/django/contrib/gis/gdal/feature.py b/django/contrib/gis/gdal/feature.py
index 6f08969984..630af7f651 100644
--- a/django/contrib/gis/gdal/feature.py
+++ b/django/contrib/gis/gdal/feature.py
@@ -8,7 +8,7 @@ from django.utils.encoding import force_bytes, force_str
# For more information, see the OGR C API source code:
-# https://gdal.org/api/vector_c_api.html
+# https://gdal.org/api/vector_c_api.html
#
# The OGR_F_* routines are relevant here.
class Feature(GDALBase):
@@ -31,7 +31,7 @@ class Feature(GDALBase):
def __getitem__(self, index):
"""
Get the Field object at the specified index, which may be either
- an integer or the Field's string label. Note that the Field object
+ an integer or the Field's string label. Note that the Field object
is not the field's _value_ -- use the `get` method instead to
retrieve the value (e.g. an integer) instead of a Field instance.
"""
@@ -106,7 +106,7 @@ class Feature(GDALBase):
def get(self, field):
"""
Return the value of the field, instead of an instance of the Field
- object. May take a string of the field name or a Field object as
+ object. May take a string of the field name or a Field object as
parameters.
"""
field_name = getattr(field, "name", field)
diff --git a/django/contrib/gis/gdal/field.py b/django/contrib/gis/gdal/field.py
index 5374f6c3cb..c202c0a420 100644
--- a/django/contrib/gis/gdal/field.py
+++ b/django/contrib/gis/gdal/field.py
@@ -8,7 +8,7 @@ from django.utils.encoding import force_str
# For more information, see the OGR C API source code:
-# https://gdal.org/api/vector_c_api.html
+# https://gdal.org/api/vector_c_api.html
#
# The OGR_Fld_* routines are relevant here.
class Field(GDALBase):
diff --git a/django/contrib/gis/gdal/geometries.py b/django/contrib/gis/gdal/geometries.py
index fb72fcd5ac..63e6ef13a3 100644
--- a/django/contrib/gis/gdal/geometries.py
+++ b/django/contrib/gis/gdal/geometries.py
@@ -5,7 +5,7 @@ OGRGeometry may be instantiated when reading geometries from OGR Data Sources
(e.g. SHP files), or when given OGC WKT (a string).
While the 'full' API is not present yet, the API is "pythonic" unlike
-the traditional and "next-generation" OGR Python bindings. One major
+the traditional and "next-generation" OGR Python bindings. One major
advantage OGR Geometries have over their GEOS counterparts is support
for spatial reference systems and their transformation.
@@ -454,7 +454,7 @@ class OGRGeometry(GDALBase):
"""
Transform this geometry to a different spatial reference system.
May take a CoordTransform object, a SpatialReference object, string
- WKT or PROJ, and/or an integer SRID. By default, return nothing
+ WKT or PROJ, and/or an integer SRID. By default, return nothing
and transform the geometry in-place. However, if the `clone` keyword is
set, return a transformed clone of this geometry.
"""
diff --git a/django/contrib/gis/gdal/layer.py b/django/contrib/gis/gdal/layer.py
index 1afa0469f6..0deb77e65c 100644
--- a/django/contrib/gis/gdal/layer.py
+++ b/django/contrib/gis/gdal/layer.py
@@ -27,8 +27,8 @@ class Layer(GDALBase):
def __init__(self, layer_ptr, ds):
"""
Initialize on an OGR C pointer to the Layer and the `DataSource` object
- that owns this layer. The `DataSource` object is required so that a
- reference to it is kept with this Layer. This prevents garbage
+ that owns this layer. The `DataSource` object is required so that a
+ reference to it is kept with this Layer. This prevents garbage
collection of the `DataSource` while this Layer is still active.
"""
if not layer_ptr:
@@ -75,7 +75,7 @@ class Layer(GDALBase):
def _make_feature(self, feat_id):
"""
Helper routine for __getitem__ that constructs a Feature from the given
- Feature ID. If the OGR Layer does not support random-access reading,
+ Feature ID. If the OGR Layer does not support random-access reading,
then each feature of the layer will be incremented through until the
a Feature is found matching the given feature ID.
"""
@@ -150,7 +150,7 @@ class Layer(GDALBase):
@property
def field_types(self):
"""
- Return a list of the types of fields in this Layer. For example,
+ Return a list of the types of fields in this Layer. For example,
return the list [OFTInteger, OFTReal, OFTString] for an OGR layer that
has an integer, a floating-point, and string fields.
"""
@@ -226,7 +226,7 @@ class Layer(GDALBase):
def test_capability(self, capability):
"""
Return a bool indicating whether the this Layer supports the given
- capability (a string). Valid capability strings include:
+ capability (a string). Valid capability strings include:
'RandomRead', 'SequentialWrite', 'RandomWrite', 'FastSpatialFilter',
'FastFeatureCount', 'FastGetExtent', 'CreateField', 'Transactions',
'DeleteFeature', and 'FastSetNextByIndex'.
diff --git a/django/contrib/gis/gdal/libgdal.py b/django/contrib/gis/gdal/libgdal.py
index 49d6363878..6a942fb630 100644
--- a/django/contrib/gis/gdal/libgdal.py
+++ b/django/contrib/gis/gdal/libgdal.py
@@ -52,7 +52,7 @@ elif os.name == "posix":
else:
raise ImproperlyConfigured('GDAL is unsupported on OS "%s".' % os.name)
-# Using the ctypes `find_library` utility to find the
+# Using the ctypes `find_library` utility to find the
# path to the GDAL library from the list of library names.
if lib_names:
for lib_name in lib_names:
@@ -71,7 +71,7 @@ if lib_path is None:
lgdal = CDLL(lib_path)
# On Windows, the GDAL binaries have some OSR routines exported with
-# STDCALL, while others are not. Thus, the library will also need to
+# STDCALL, while others are not. Thus, the library will also need to
# be loaded up as WinDLL for said OSR functions that require the
# different calling convention.
if os.name == "nt":
diff --git a/django/contrib/gis/gdal/prototypes/errcheck.py b/django/contrib/gis/gdal/prototypes/errcheck.py
index d970b2e4d2..82b1360687 100644
--- a/django/contrib/gis/gdal/prototypes/errcheck.py
+++ b/django/contrib/gis/gdal/prototypes/errcheck.py
@@ -37,9 +37,9 @@ def check_const_string(result, func, cargs, offset=None, cpl=False):
def check_string(result, func, cargs, offset=-1, str_result=False):
"""
Check the string output returned from the given function, and free
- the string pointer allocated by OGR. The `str_result` keyword
+ the string pointer allocated by OGR. The `str_result` keyword
may be used when the result is the string pointer, otherwise
- the OGR error code is assumed. The `offset` keyword may be used
+ the OGR error code is assumed. The `offset` keyword may be used
to extract the string pointer passed in by-reference at the given
slice offset in the function arguments.
"""
@@ -134,7 +134,7 @@ def check_pointer(result, func, cargs):
def check_str_arg(result, func, cargs):
"""
This is for the OSRGet[Angular|Linear]Units functions, which
- require that the returned string pointer not be freed. This
+ require that the returned string pointer not be freed. This
returns both the double and string values.
"""
dbl = result
diff --git a/django/contrib/gis/gdal/srs.py b/django/contrib/gis/gdal/srs.py
index 8bf72ab63d..7062354bf2 100644
--- a/django/contrib/gis/gdal/srs.py
+++ b/django/contrib/gis/gdal/srs.py
@@ -113,8 +113,8 @@ class SpatialReference(GDALBase):
def __getitem__(self, target):
"""
Return the value of the given string attribute node, None if the node
- doesn't exist. Can also take a tuple as a parameter, (target, child),
- where child is the index of the attribute in the WKT. For example:
+ doesn't exist. Can also take a tuple as a parameter, (target, child),
+ where child is the index of the attribute in the WKT. For example:
>>> wkt = 'GEOGCS["WGS 84", DATUM["WGS_1984, ... AUTHORITY["EPSG","4326"]]'
>>> srs = SpatialReference(wkt) # could also use 'WGS84', or 4326
diff --git a/django/contrib/gis/geoip2.py b/django/contrib/gis/geoip2.py
index 1e4a464068..c902522379 100644
--- a/django/contrib/gis/geoip2.py
+++ b/django/contrib/gis/geoip2.py
@@ -81,7 +81,7 @@ class GeoIP2:
* cache: The cache settings when opening up the GeoIP datasets. May be
an integer in (0, 1, 2, 4, 8) corresponding to the MODE_AUTO,
MODE_MMAP_EXT, MODE_MMAP, MODE_FILE, and MODE_MEMORY,
- `GeoIPOptions` C API settings, respectively. Defaults to 0,
+ `GeoIPOptions` C API settings, respectively. Defaults to 0,
meaning MODE_AUTO.
* country: The name of the GeoIP country data file. Defaults to
diff --git a/django/contrib/gis/geometry.py b/django/contrib/gis/geometry.py
index 7aac8644ee..f298ab2648 100644
--- a/django/contrib/gis/geometry.py
+++ b/django/contrib/gis/geometry.py
@@ -2,7 +2,7 @@ import re
from django.utils.regex_helper import _lazy_re_compile
-# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
+# Regular expression for recognizing HEXEWKB and WKT. A prophylactic measure
# to prevent potentially malicious input from reaching the underlying C
# library. Not a substitute for good web security programming practices.
hex_regex = _lazy_re_compile(r"^[0-9A-F]+$", re.I)
diff --git a/django/contrib/gis/geos/__init__.py b/django/contrib/gis/geos/__init__.py
index f50cd19856..060c75fdd9 100644
--- a/django/contrib/gis/geos/__init__.py
+++ b/django/contrib/gis/geos/__init__.py
@@ -1,5 +1,5 @@
"""
-The GeoDjango GEOS module. Please consult the GeoDjango documentation
+The GeoDjango GEOS module. Please consult the GeoDjango documentation
for more details: https://docs.djangoproject.com/en/dev/ref/contrib/gis/geos/
"""
diff --git a/django/contrib/gis/geos/geometry.py b/django/contrib/gis/geos/geometry.py
index 477b7afa5e..cfc2d695ea 100644
--- a/django/contrib/gis/geos/geometry.py
+++ b/django/contrib/gis/geos/geometry.py
@@ -609,7 +609,7 @@ class GEOSGeometryBase(GEOSBase):
def simplify(self, tolerance=0.0, preserve_topology=False):
"""
Return the Geometry, simplified using the Douglas-Peucker algorithm
- to the specified tolerance (higher tolerance => less points). If no
+ to the specified tolerance (higher tolerance => less points). If no
tolerance provided, defaults to 0.
By default, don't preserve topology - e.g. polygons can be split,
diff --git a/django/contrib/gis/geos/io.py b/django/contrib/gis/geos/io.py
index 8dd3f289e6..3c84345da5 100644
--- a/django/contrib/gis/geos/io.py
+++ b/django/contrib/gis/geos/io.py
@@ -1,6 +1,6 @@
"""
Module that holds classes for performing I/O operations on GEOS geometry
-objects. Specifically, this has Python implementations of WKB/WKT
+objects. Specifically, this has Python implementations of WKB/WKT
reader and writer classes.
"""
diff --git a/django/contrib/gis/geos/libgeos.py b/django/contrib/gis/geos/libgeos.py
index 2707fef283..501c28c6d3 100644
--- a/django/contrib/gis/geos/libgeos.py
+++ b/django/contrib/gis/geos/libgeos.py
@@ -41,7 +41,7 @@ def load_geos():
raise ImportError('Unsupported OS "%s"' % os.name)
# Using the ctypes `find_library` utility to find the path to the GEOS
- # shared library. This is better than manually specifying each library name
+ # shared library. This is better than manually specifying each library name
# and extension (e.g., libgeos_c.[so|so.1|dylib].).
if lib_names:
for lib_name in lib_names:
@@ -55,13 +55,13 @@ def load_geos():
'Could not find the GEOS library (tried "%s"). '
"Try setting GEOS_LIBRARY_PATH in your settings." % '", "'.join(lib_names)
)
- # Getting the GEOS C library. The C interface (CDLL) is used for
+ # Getting the GEOS C library. The C interface (CDLL) is used for
# both *NIX and Windows.
# See the GEOS C API source code for more details on the library function calls:
# https://libgeos.org/doxygen/geos__c_8h_source.html
_lgeos = CDLL(lib_path)
# Here we set up the prototypes for the initGEOS_r and finishGEOS_r
- # routines. These functions aren't actually called until they are
+ # routines. These functions aren't actually called until they are
# attached to a GEOS context handle -- this actually occurs in
# geos/prototypes/threadsafe.py.
_lgeos.initGEOS_r.restype = CONTEXT_PTR
diff --git a/django/contrib/gis/geos/linestring.py b/django/contrib/gis/geos/linestring.py
index 78a265cebf..357084cc8d 100644
--- a/django/contrib/gis/geos/linestring.py
+++ b/django/contrib/gis/geos/linestring.py
@@ -14,7 +14,7 @@ class LineString(LinearGeometryMixin, GEOSGeometry):
def __init__(self, *args, **kwargs):
"""
Initialize on the given sequence -- may take lists, tuples, NumPy arrays
- of X,Y pairs, or Point objects. If Point objects are used, ownership is
+ of X,Y pairs, or Point objects. If Point objects are used, ownership is
_not_ transferred to the LineString object.
Examples:
diff --git a/django/contrib/gis/geos/polygon.py b/django/contrib/gis/geos/polygon.py
index 9e8d30647b..554447c73f 100644
--- a/django/contrib/gis/geos/polygon.py
+++ b/django/contrib/gis/geos/polygon.py
@@ -127,7 +127,7 @@ class Polygon(GEOSGeometry):
def _get_single_internal(self, index):
"""
Return the ring at the specified index. The first index, 0, will
- always return the exterior ring. Indices > 0 will return the
+ always return the exterior ring. Indices > 0 will return the
interior ring at the given index (e.g., poly[1] and poly[2] would
return the first and second interior ring, respectively).
diff --git a/django/contrib/gis/geos/prototypes/geom.py b/django/contrib/gis/geos/prototypes/geom.py
index 3996544033..89f8ad4d4a 100644
--- a/django/contrib/gis/geos/prototypes/geom.py
+++ b/django/contrib/gis/geos/prototypes/geom.py
@@ -14,7 +14,7 @@ c_uchar_p = POINTER(c_ubyte)
# We create a simple subclass of c_char_p here because when the response
# type is set to c_char_p, you get a _Python_ string and there's no way
# to access the string's address inside the error checking function.
-# In other words, you can't free the memory allocated inside GEOS. Previously,
+# In other words, you can't free the memory allocated inside GEOS. Previously,
# the return type would just be omitted and the integer address would be
# used -- but this allows us to be specific in the function definition and
# keeps the reference so it may be free'd.
diff --git a/django/contrib/gis/geos/prototypes/io.py b/django/contrib/gis/geos/prototypes/io.py
index def976329d..e86d82ad09 100644
--- a/django/contrib/gis/geos/prototypes/io.py
+++ b/django/contrib/gis/geos/prototypes/io.py
@@ -82,7 +82,7 @@ wkb_reader_destroy = GEOSFuncFactory("GEOSWKBReader_destroy", argtypes=[WKB_READ
class WKBReadFunc(GEOSFuncFactory):
# Although the function definitions take `const unsigned char *`
# as their parameter, we use c_char_p here so the function may
- # take Python strings directly as parameters. Inside Python there
+ # take Python strings directly as parameters. Inside Python there
# is not a difference between signed and unsigned characters, so
# it is not a problem.
argtypes = [WKB_READ_PTR, c_char_p, c_size_t]
@@ -318,7 +318,7 @@ class WKBWriter(IOBase):
# `ThreadLocalIO` object holds instances of the WKT and WKB reader/writer
-# objects that are local to the thread. The `GEOSGeometry` internals
+# objects that are local to the thread. The `GEOSGeometry` internals
# access these instances by calling the module-level functions, defined
# below.
class ThreadLocalIO(threading.local):
diff --git a/django/contrib/gis/sitemaps/views.py b/django/contrib/gis/sitemaps/views.py
index 17eb54e60c..725543f18e 100644
--- a/django/contrib/gis/sitemaps/views.py
+++ b/django/contrib/gis/sitemaps/views.py
@@ -18,7 +18,7 @@ def kml(request, label, model, field_name=None, compress=False, using=DEFAULT_DB
klass = apps.get_model(label, model)
except LookupError:
raise Http404(
- 'You must supply a valid app label and module name. Got "%s.%s"'
+ 'You must supply a valid app label and module name. Got "%s.%s"'
% (label, model)
)
diff --git a/django/contrib/gis/utils/layermapping.py b/django/contrib/gis/utils/layermapping.py
index 137dd6b7f7..f5c5695b80 100644
--- a/django/contrib/gis/utils/layermapping.py
+++ b/django/contrib/gis/utils/layermapping.py
@@ -109,7 +109,7 @@ class LayerMapping:
"""
A LayerMapping object is initialized using the given Model (not an instance),
a DataSource (or string path to an OGR-supported data file), and a mapping
- dictionary. See the module level docstring for more details and keyword
+ dictionary. See the module level docstring for more details and keyword
argument usage.
"""
# Getting the DataSource and the associated Layer.
@@ -195,7 +195,7 @@ class LayerMapping:
need to increment through each feature in the Layer.
"""
# The geometry field of the model is set here.
- # TODO: Support more than one geometry field / model. However, this
+ # TODO: Support more than one geometry field / model. However, this
# depends on the GDAL Driver in use.
self.geom_field = False
self.fields = {}
@@ -263,7 +263,7 @@ class LayerMapping:
)
# Setting the `geom_field` attribute w/the name of the model field
- # that is a Geometry. Also setting the coordinate dimension
+ # that is a Geometry. Also setting the coordinate dimension
# attribute.
self.geom_field = field_name
self.coord_dim = coord_dim
@@ -570,7 +570,7 @@ class LayerMapping:
fid_range:
May be set with a slice or tuple of (begin, end) feature ID's to map
- from the data source. In other words, this keyword enables the user
+ from the data source. In other words, this keyword enables the user
to selectively import a subset range of features in the geographic
data source.
@@ -581,13 +581,13 @@ class LayerMapping:
progress:
When this keyword is set, status information will be printed giving
- the number of features processed and successfully saved. By default,
+ the number of features processed and successfully saved. By default,
progress information will pe printed every 1000 features processed,
however, this default may be overridden by setting this keyword with an
integer for the desired interval.
stream:
- Status information will be written to this file handle. Defaults to
+ Status information will be written to this file handle. Defaults to
using `sys.stdout`, but any object with a `write` method is supported.
silent:
@@ -596,7 +596,7 @@ class LayerMapping:
strict:
Execution of the model mapping will cease upon the first error
- encountered. The default behavior is to attempt to continue.
+ encountered. The default behavior is to attempt to continue.
"""
# Getting the default Feature ID range.
default_range = self.check_fid_range(fid_range)
diff --git a/django/contrib/gis/utils/ogrinspect.py b/django/contrib/gis/utils/ogrinspect.py
index 76c8bfbcfa..88ce8aaff3 100644
--- a/django/contrib/gis/utils/ogrinspect.py
+++ b/django/contrib/gis/utils/ogrinspect.py
@@ -25,7 +25,7 @@ def mapping(data_source, geom_name="geom", layer_key=0, multi_geom=False):
`geom_name` => The name of the geometry field to use for the model.
`layer_key` => The key for specifying which layer in the DataSource to use;
- defaults to 0 (the first layer). May be an integer index or a string
+ defaults to 0 (the first layer). May be an integer index or a string
identifier for the layer.
`multi_geom` => Boolean (default: False) - specify as multigeometry.
@@ -91,10 +91,10 @@ def ogrinspect(*args, **kwargs):
Otherwise will default to `geom`
`layer_key` => The key for specifying which layer in the DataSource to use;
- defaults to 0 (the first layer). May be an integer index or a string
+ defaults to 0 (the first layer). May be an integer index or a string
identifier for the layer.
- `srid` => The SRID to use for the Geometry Field. If it can be determined,
+ `srid` => The SRID to use for the Geometry Field. If it can be determined,
the SRID of the datasource is used.
`multi_geom` => Boolean (default: False) - specify as multigeometry.
@@ -107,18 +107,18 @@ def ogrinspect(*args, **kwargs):
autogenerated models thus avoiding duplicated imports when building
more than one model by batching ogrinspect()
- `decimal` => Boolean or sequence (default: False). When set to True
+ `decimal` => Boolean or sequence (default: False). When set to True
all generated model fields corresponding to the `OFTReal` type will
- be `DecimalField` instead of `FloatField`. A sequence of specific
+ be `DecimalField` instead of `FloatField`. A sequence of specific
field names to generate as `DecimalField` may also be used.
- `blank` => Boolean or sequence (default: False). When set to True all
- generated model fields will have `blank=True`. If the user wants to
+ `blank` => Boolean or sequence (default: False). When set to True all
+ generated model fields will have `blank=True`. If the user wants to
give specific fields to have blank, then a list/tuple of OGR field
names may be used.
`null` => Boolean (default: False) - When set to True all generated
- model fields will have `null=True`. If the user wants to specify
+ model fields will have `null=True`. If the user wants to specify
give specific fields to have null, then a list/tuple of OGR field
names may be used.
@@ -142,7 +142,7 @@ def _ogrinspect(
):
"""
Helper routine for `ogrinspect` that generates GeoDjango models corresponding
- to the given data source. See the `ogrinspect` docstring for more details.
+ to the given data source. See the `ogrinspect` docstring for more details.
"""
# Getting the DataSource
if isinstance(data_source, str):
diff --git a/django/contrib/gis/utils/srs.py b/django/contrib/gis/utils/srs.py
index 2204767923..94d141f1cb 100644
--- a/django/contrib/gis/utils/srs.py
+++ b/django/contrib/gis/utils/srs.py
@@ -8,7 +8,7 @@ def add_srs_entry(
"""
Take a GDAL SpatialReference system and add its information to the
`spatial_ref_sys` table of the spatial backend. Doing this enables
- database-level spatial transformations for the backend. Thus, this utility
+ database-level spatial transformations for the backend. Thus, this utility
is useful for adding spatial reference systems not included by default with
the backend:
diff --git a/django/contrib/sessions/backends/file.py b/django/contrib/sessions/backends/file.py
index 9710cd2769..8f085595cb 100644
--- a/django/contrib/sessions/backends/file.py
+++ b/django/contrib/sessions/backends/file.py
@@ -130,7 +130,7 @@ class SessionStore(SessionBase):
session_file_name = self._key_to_file()
try:
- # Make sure the file exists. If it does not already exist, an
+ # Make sure the file exists. If it does not already exist, an
# empty placeholder file is created.
flags = os.O_WRONLY | getattr(os, "O_BINARY", 0)
if must_create:
@@ -145,7 +145,7 @@ class SessionStore(SessionBase):
raise CreateError
# Write the session file without interfering with other threads
- # or processes. By writing to an atomically generated temporary
+ # or processes. By writing to an atomically generated temporary
# file and then using the atomic os.rename() to make the complete
# file visible, we avoid having to lock the session file, while
# still maintaining its integrity.
@@ -153,7 +153,7 @@ class SessionStore(SessionBase):
# Note: Locking the session file was explored, but rejected in part
# because in order to be atomic and cross-platform, it required a
# long-lived lock file for each session, doubling the number of
- # files in the session storage directory at any given time. This
+ # files in the session storage directory at any given time. This
# rename solution is cleaner and avoids any additional overhead
# when reading the session data, which is the more common case
# unless SESSION_SAVE_EVERY_REQUEST = True.
diff --git a/django/core/cache/__init__.py b/django/core/cache/__init__.py
index 444d958e68..4354941cb0 100644
--- a/django/core/cache/__init__.py
+++ b/django/core/cache/__init__.py
@@ -3,7 +3,7 @@ Caching framework.
This package defines set of cache backends that all conform to a simple API.
In a nutshell, a cache is a set of values -- which can be any object that
-may be pickled -- identified by string keys. For the complete API, see
+may be pickled -- identified by string keys. For the complete API, see
the abstract BaseCache class in django.core.cache.backends.base.
Client code should use the `cache` variable defined here to access the default
diff --git a/django/core/cache/backends/base.py b/django/core/cache/backends/base.py
index 1111fdb41f..aef9986389 100644
--- a/django/core/cache/backends/base.py
+++ b/django/core/cache/backends/base.py
@@ -303,7 +303,7 @@ class BaseCache:
def set_many(self, data, timeout=DEFAULT_TIMEOUT, version=None):
"""
Set a bunch of values in the cache at once from a dict of key/value
- pairs. For certain backends (memcached), this is much more efficient
+ pairs. For certain backends (memcached), this is much more efficient
than calling set() multiple times.
If timeout is given, use that timeout for the key; otherwise use the
diff --git a/django/core/files/images.py b/django/core/files/images.py
index 7c1532ac8f..c7d71dc809 100644
--- a/django/core/files/images.py
+++ b/django/core/files/images.py
@@ -34,7 +34,7 @@ class ImageFile(File):
def get_image_dimensions(file_or_path, close=False):
"""
- Return the (width, height) of an image, given an open file or a path. Set
+ Return the (width, height) of an image, given an open file or a path. Set
'close' to True to close the file at the end if it is initially in an open
state.
"""
diff --git a/django/core/files/move.py b/django/core/files/move.py
index 57508fab82..1605bebc1a 100644
--- a/django/core/files/move.py
+++ b/django/core/files/move.py
@@ -84,7 +84,7 @@ def file_move_safe(
os.remove(old_file_name)
except PermissionError as e:
# Certain operating systems (Cygwin and Windows)
- # fail when deleting opened files, ignore it. (For the
+ # fail when deleting opened files, ignore it. (For the
# systems where this happens, temporary files will be auto-deleted
# on close anyway.)
if getattr(e, "winerror", 0) != 32:
diff --git a/django/core/files/utils.py b/django/core/files/utils.py
index c730ca17e8..a80faeb3cf 100644
--- a/django/core/files/utils.py
+++ b/django/core/files/utils.py
@@ -26,7 +26,7 @@ def validate_file_name(name, allow_relative_path=False):
class FileProxyMixin:
"""
A mixin class used to forward file methods to an underlying file
- object. The internal file object has to be called "file"::
+ object. The internal file object has to be called "file"::
class FileProxy(FileProxyMixin):
def __init__(self, file):
diff --git a/django/core/management/base.py b/django/core/management/base.py
index 12b4b42f61..92a3abb01e 100644
--- a/django/core/management/base.py
+++ b/django/core/management/base.py
@@ -214,7 +214,7 @@ class BaseCommand:
SQL statements, will be wrapped in ``BEGIN`` and ``COMMIT``.
4. If ``handle()`` or ``execute()`` raised any exception (e.g.
- ``CommandError``), ``run_from_argv()`` will instead print an error
+ ``CommandError``), ``run_from_argv()`` will instead print an error
message to ``stderr``.
Thus, the ``handle()`` method is typically the starting point for
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 148565dab0..ac67a5bc9f 100644
--- a/django/core/management/commands/makemessages.py
+++ b/django/core/management/commands/makemessages.py
@@ -297,7 +297,7 @@ class Command(BaseCommand):
nargs="?",
help=(
"Controls '#: filename:line' lines. If the option is 'full' "
- "(the default if not given), the lines include both file name "
+ "(the default if not given), the lines include both file name "
"and line number. If it's 'file', the line number is omitted. If "
"it's 'never', the lines are suppressed (same as --no-location). "
"--add-location requires gettext 0.19 or newer."
diff --git a/django/core/serializers/__init__.py b/django/core/serializers/__init__.py
index 480c54b79b..7e23769533 100644
--- a/django/core/serializers/__init__.py
+++ b/django/core/serializers/__init__.py
@@ -199,7 +199,7 @@ def sort_dependencies(app_list, allow_cycles=False):
if hasattr(rel_model, "natural_key") and rel_model != model:
deps.append(rel_model)
# Also add a dependency for any simple M2M relation with a model
- # that defines a natural key. M2M relations with explicit through
+ # that defines a natural key. M2M relations with explicit through
# models don't count as dependencies.
for field in model._meta.many_to_many:
if field.remote_field.through._meta.auto_created:
diff --git a/django/db/backends/oracle/base.py b/django/db/backends/oracle/base.py
index 9fd82dd705..d00c28c3e9 100644
--- a/django/db/backends/oracle/base.py
+++ b/django/db/backends/oracle/base.py
@@ -309,7 +309,7 @@ class DatabaseWrapper(BaseDatabaseWrapper):
# these are set in single statement it isn't clear what is supposed
# to happen.
cursor.execute("ALTER SESSION SET NLS_TERRITORY = 'AMERICA'")
- # Set Oracle date to ANSI date format. This only needs to execute
+ # Set Oracle date to ANSI date format. This only needs to execute
# once when we create a new connection. We also set the Territory
# to 'AMERICA' which forces Sunday to evaluate to a '1' in
# TO_CHAR().
@@ -578,8 +578,8 @@ class FormatStylePlaceholderCursor:
return [p.force_bytes for p in params]
def _fix_for_params(self, query, params, unify_by_values=False):
- # oracledb wants no trailing ';' for SQL statements. For PL/SQL, it
- # it does want a trailing ';' but not a trailing '/'. However, these
+ # oracledb wants no trailing ';' for SQL statements. For PL/SQL, it
+ # does want a trailing ';' but not a trailing '/'. However, these
# characters must be included in the original query in case the query
# is being passed to SQL*Plus.
if query.endswith(";") or query.endswith("/"):
diff --git a/django/db/backends/oracle/operations.py b/django/db/backends/oracle/operations.py
index 3f4cf8156a..46a681a520 100644
--- a/django/db/backends/oracle/operations.py
+++ b/django/db/backends/oracle/operations.py
@@ -372,7 +372,7 @@ END;
return value.read()
def quote_name(self, name):
- # SQL92 requires delimited (quoted) names to be case-sensitive. When
+ # SQL92 requires delimited (quoted) names to be case-sensitive. When
# not quoted, Oracle has case-insensitive behavior for identifiers, but
# always defaults to uppercase.
# We simplify things by making Oracle identifiers always uppercase.
diff --git a/django/db/models/deletion.py b/django/db/models/deletion.py
index da2e934c96..9221364ff4 100644
--- a/django/db/models/deletion.py
+++ b/django/db/models/deletion.py
@@ -115,7 +115,7 @@ class Collector:
def add(self, objs, source=None, nullable=False, reverse_dependency=False):
"""
- Add 'objs' to the collection of objects to be deleted. If the call is
+ Add 'objs' to the collection of objects to be deleted. If the call is
the result of a cascade, 'source' should be the model that caused it,
and 'nullable' should be set to True if the relation can be null.
@@ -254,8 +254,8 @@ class Collector:
):
"""
Add 'objs' to the collection of objects to be deleted as well as all
- parent instances. 'objs' must be a homogeneous iterable collection of
- model instances (e.g. a QuerySet). If 'collect_related' is True,
+ parent instances. 'objs' must be a homogeneous iterable collection of
+ model instances (e.g. a QuerySet). If 'collect_related' is True,
related objects will be handled by their respective on_delete handler.
If the call is the result of a cascade, 'source' should be the model
diff --git a/django/db/models/fields/files.py b/django/db/models/fields/files.py
index 03c3939a4e..8f807b1156 100644
--- a/django/db/models/fields/files.py
+++ b/django/db/models/fields/files.py
@@ -388,10 +388,10 @@ class ImageFileDescriptor(FileDescriptor):
# To prevent recalculating image dimensions when we are instantiating
# an object from the database (bug #11084), only update dimensions if
- # the field had a value before this assignment. Since the default
+ # the field had a value before this assignment. Since the default
# value for FileField subclasses is an instance of field.attr_class,
# previous_file will only be None when we are called from
- # Model.__init__(). The ImageField.update_dimension_fields method
+ # Model.__init__(). The ImageField.update_dimension_fields method
# hooked up to the post_init signal handles the Model.__init__() cases.
# Assignment happening outside of Model.__init__() will trigger the
# update right here.
@@ -476,8 +476,8 @@ class ImageField(FileField):
Update field's width and height fields, if defined.
This method is hooked up to model's post_init signal to update
- dimensions after instantiating a model instance. However, dimensions
- won't be updated if the dimensions fields are already populated. This
+ dimensions after instantiating a model instance. However, dimensions
+ won't be updated if the dimensions fields are already populated. This
avoids unnecessary recalculation when loading an object from the
database.
@@ -505,9 +505,9 @@ class ImageField(FileField):
)
# When both dimension fields have values, we are most likely loading
# data from the database or updating an image field that already had
- # an image stored. In the first case, we don't want to update the
+ # an image stored. In the first case, we don't want to update the
# dimension fields because we are already getting their values from the
- # database. In the second case, we do want to update the dimensions
+ # database. In the second case, we do want to update the dimensions
# fields and will skip this return because force will be True since we
# were called from ImageFileDescriptor.__set__.
if dimension_fields_filled and not force:
diff --git a/django/db/models/query.py b/django/db/models/query.py
index 63ab4a873a..8163b5b973 100644
--- a/django/db/models/query.py
+++ b/django/db/models/query.py
@@ -2326,7 +2326,7 @@ def prefetch_related_objects(model_instances, *related_lookups):
return # nothing to do
# We need to be able to dynamically add to the list of prefetch_related
- # lookups that we look up (see below). So we need some book keeping to
+ # lookups that we look up (see below). So we need some book keeping to
# ensure we don't do duplicate work.
done_queries = {} # dictionary of things like 'foo__bar': [results]
diff --git a/django/http/request.py b/django/http/request.py
index daaf3748cc..ff5974770f 100644
--- a/django/http/request.py
+++ b/django/http/request.py
@@ -232,7 +232,7 @@ class HttpRequest:
"""
Attempt to return a signed cookie. If the signature fails or the
cookie has expired, raise an exception, unless the `default` argument
- is provided, in which case return that value.
+ is provided, in which case return that value.
"""
try:
cookie_value = self.COOKIES[key]
diff --git a/django/middleware/csrf.py b/django/middleware/csrf.py
index 5ae1aae5c6..2e4b30ed54 100644
--- a/django/middleware/csrf.py
+++ b/django/middleware/csrf.py
@@ -100,7 +100,7 @@ def get_token(request):
A side effect of calling this function is to make the csrf_protect
decorator and the CsrfViewMiddleware add a CSRF cookie and a 'Vary: Cookie'
- header to the outgoing response. For this reason, you may need to use this
+ header to the outgoing response. For this reason, you may need to use this
function lazily, as is done by the csrf context processor.
"""
if "CSRF_COOKIE" in request.META:
@@ -201,7 +201,7 @@ class CsrfViewMiddleware(MiddlewareMixin):
# requires_csrf_token decorator.
def _accept(self, request):
# Avoid checking the request twice by adding a custom attribute to
- # request. This will be relevant when both decorator and middleware
+ # request. This will be relevant when both decorator and middleware
# are used.
request.csrf_processing_done = True
return None
diff --git a/django/template/defaulttags.py b/django/template/defaulttags.py
index a511f17310..17a97ec788 100644
--- a/django/template/defaulttags.py
+++ b/django/template/defaulttags.py
@@ -87,7 +87,7 @@ class CsrfTokenNode(Node):
if settings.DEBUG:
warnings.warn(
"A {% csrf_token %} was used in a template, but the context "
- "did not provide the value. This is usually caused by not "
+ "did not provide the value. This is usually caused by not "
"using RequestContext."
)
return ""
@@ -205,7 +205,7 @@ class ForNode(Node):
values = reversed(values)
num_loopvars = len(self.loopvars)
unpack = num_loopvars > 1
- # Create a forloop value in the context. We'll update counters on each
+ # Create a forloop value in the context. We'll update counters on each
# iteration just below.
loop_dict = context["forloop"] = {
"parentloop": parentloop,
@@ -720,7 +720,7 @@ def do_filter(parser, token):
filter_name = getattr(func, "_filter_name", None)
if filter_name in ("escape", "safe"):
raise TemplateSyntaxError(
- '"filter %s" is not permitted. Use the "autoescape" tag instead.'
+ '"filter %s" is not permitted. Use the "autoescape" tag instead.'
% filter_name
)
nodelist = parser.parse(("endfilter",))
diff --git a/django/template/library.py b/django/template/library.py
index 3ec39ff572..1a65087e92 100644
--- a/django/template/library.py
+++ b/django/template/library.py
@@ -484,5 +484,5 @@ def import_library(name):
return module.register
except AttributeError:
raise InvalidTemplateLibrary(
- "Module %s does not have a variable named 'register'" % name,
+ "Module %s does not have a variable named 'register'" % name,
)
diff --git a/django/template/smartif.py b/django/template/smartif.py
index 6a6a03dd84..c1ed0ff065 100644
--- a/django/template/smartif.py
+++ b/django/template/smartif.py
@@ -3,7 +3,7 @@ Parser and utilities for the smart 'if' tag
"""
# Using a simple top down parser, as described here:
-# https://11l-lang.org/archive/simple-top-down-parsing/
+# https://11l-lang.org/archive/simple-top-down-parsing/
# 'led' = left denotation
# 'nud' = null denotation
# 'bp' = binding power (left = lbp, right = rbp)
@@ -60,7 +60,7 @@ def infix(bp, func):
try:
return func(context, self.first, self.second)
except Exception:
- # Templates shouldn't throw exceptions when rendering. We are
+ # Templates shouldn't throw exceptions when rendering. We are
# most likely to get exceptions for things like {% if foo in bar
# %} where 'bar' does not support 'in', so default to False
return False
diff --git a/django/templatetags/cache.py b/django/templatetags/cache.py
index 1c48db7ce9..8c0b2722e1 100644
--- a/django/templatetags/cache.py
+++ b/django/templatetags/cache.py
@@ -77,7 +77,7 @@ def do_cache(parser, token):
Optionally the cache to use may be specified thus::
- {% cache .... using="cachename" %}
+ {% cache .... using="cachename" %}
Each unique set of arguments will result in a unique cache entry.
"""
diff --git a/django/test/client.py b/django/test/client.py
index c733372130..fe4cb8f9d7 100644
--- a/django/test/client.py
+++ b/django/test/client.py
@@ -177,7 +177,7 @@ class ClientHandler(BaseHandler):
request_started.connect(close_old_connections)
request = WSGIRequest(environ)
# sneaky little hack so that we can easily get round
- # CsrfViewMiddleware. This makes life easier, and is probably
+ # CsrfViewMiddleware. This makes life easier, and is probably
# required for backwards compatibility with external tests against
# admin views.
request._dont_enforce_csrf_checks = not self.enforce_csrf_checks
diff --git a/django/utils/archive.py b/django/utils/archive.py
index 56f34c0038..4042e89af9 100644
--- a/django/utils/archive.py
+++ b/django/utils/archive.py
@@ -101,7 +101,7 @@ class Archive:
class BaseArchive:
"""
- Base Archive class. Implementations should inherit this class.
+ Base Archive class. Implementations should inherit this class.
"""
@staticmethod
diff --git a/django/utils/crypto.py b/django/utils/crypto.py
index 5134b854d6..4b8146695a 100644
--- a/django/utils/crypto.py
+++ b/django/utils/crypto.py
@@ -35,7 +35,7 @@ def salted_hmac(key_salt, value, secret=None, *, algorithm="sha1"):
raise InvalidAlgorithm(
"%r is not an algorithm accepted by the hashlib module." % algorithm
) from e
- # We need to generate a derived key from our base key. We can do this by
+ # We need to generate a derived key from our base key. We can do this by
# passing the key_salt and our base key through a pseudo-random function.
key = hasher(key_salt + secret).digest()
# If len(key_salt + secret) > block size of the hash algorithm, the above
diff --git a/django/utils/timesince.py b/django/utils/timesince.py
index 766b6f7030..a61b02d94d 100644
--- a/django/utils/timesince.py
+++ b/django/utils/timesince.py
@@ -39,7 +39,7 @@ def timesince(d, now=None, reversed=False, time_strings=None, depth=2):
but also between 2007/08/10 and 2008/09/10 despite the delta being 393 days
in the former case and 397 in the latter.
- Up to `depth` adjacent units will be displayed. For example,
+ Up to `depth` adjacent units will be displayed. For example,
"2 weeks, 3 days" and "1 year, 3 months" are possible outputs, but
"2 weeks, 3 hours" and "1 year, 5 days" are not.
diff --git a/django/views/decorators/csrf.py b/django/views/decorators/csrf.py
index 4b8b8804b0..64c478b42e 100644
--- a/django/views/decorators/csrf.py
+++ b/django/views/decorators/csrf.py
@@ -9,7 +9,7 @@ csrf_protect = decorator_from_middleware(CsrfViewMiddleware)
csrf_protect.__name__ = "csrf_protect"
csrf_protect.__doc__ = """
This decorator adds CSRF protection in exactly the same way as
-CsrfViewMiddleware, but it can be used on a per view basis. Using both, or
+CsrfViewMiddleware, but it can be used on a per view basis. Using both, or
using the decorator multiple times, is harmless and efficient.
"""
diff --git a/django/views/decorators/http.py b/django/views/decorators/http.py
index efdaa21e30..408039937c 100644
--- a/django/views/decorators/http.py
+++ b/django/views/decorators/http.py
@@ -20,7 +20,7 @@ conditional_page = decorator_from_middleware(ConditionalGetMiddleware)
def require_http_methods(request_method_list):
"""
- Decorator to make a view only accept particular request methods. Usage::
+ Decorator to make a view only accept particular request methods. Usage::
@require_http_methods(["GET", "POST"])
def my_view(request):
diff --git a/django/views/generic/edit.py b/django/views/generic/edit.py
index ebd071cf00..d016b09634 100644
--- a/django/views/generic/edit.py
+++ b/django/views/generic/edit.py
@@ -123,7 +123,7 @@ class ModelFormMixin(FormMixin, SingleObjectMixin):
url = self.object.get_absolute_url()
except AttributeError:
raise ImproperlyConfigured(
- "No URL to redirect to. Either provide a url or define"
+ "No URL to redirect to. Either provide a url or define"
" a get_absolute_url method on the Model."
)
return url
diff --git a/django/views/static.py b/django/views/static.py
index b24f0e30f9..0a583a7405 100644
--- a/django/views/static.py
+++ b/django/views/static.py
@@ -37,7 +37,7 @@ def serve(request, path, document_root=None, show_indexes=False):
in your URLconf. You must provide the ``document_root`` param. You may
also set ``show_indexes`` to ``True`` if you'd like to serve a basic index
- of the directory. This index view will use the template hardcoded below,
+ of the directory. This index view will use the template hardcoded below,
but if you'd like to override it, you can create a template called
``static/directory_index.html``.
"""
@@ -105,7 +105,7 @@ def was_modified_since(header=None, mtime=0):
Was something modified since the user last downloaded it?
header
- This is the value of the If-Modified-Since header. If this is None,
+ This is the value of the If-Modified-Since header. If this is None,
I'll just return True.
mtime