diff --git a/docs/howto/custom-template-backend.txt b/docs/howto/custom-template-backend.txt index 85e8591cbd..640f6918f7 100644 --- a/docs/howto/custom-template-backend.txt +++ b/docs/howto/custom-template-backend.txt @@ -154,7 +154,8 @@ Origin API and 3rd-party integration Django templates have an :class:`~django.template.base.Origin` object available through the ``template.origin`` attribute. This enables debug information to be displayed in the :ref:`template postmortem `, as well as -in 3rd-party libraries, like the `Django Debug Toolbar`_. +in 3rd-party libraries, like the :pypi:`Django Debug Toolbar +`. Custom engines can provide their own ``template.origin`` information by creating an object that specifies the following attributes: @@ -168,4 +169,3 @@ creating an object that specifies the following attributes: to load the template, e.g. ``django.template.loaders.filesystem.Loader``. .. _DEP 182: https://github.com/django/deps/blob/main/final/0182-multiple-template-engines.rst -.. _Django Debug Toolbar: https://github.com/jazzband/django-debug-toolbar/ diff --git a/docs/internals/contributing/writing-code/coding-style.txt b/docs/internals/contributing/writing-code/coding-style.txt index 73c120f71e..c1838b77a3 100644 --- a/docs/internals/contributing/writing-code/coding-style.txt +++ b/docs/internals/contributing/writing-code/coding-style.txt @@ -35,8 +35,8 @@ with them. Python style ============ -* All files should be formatted using the `black`_ auto-formatter. This will be - run by ``pre-commit`` if that is configured. +* All files should be formatted using the :pypi:`black` auto-formatter. This + will be run by ``pre-commit`` if that is configured. * The project repository includes an ``.editorconfig`` file. We recommend using a text editor with `EditorConfig`_ support to avoid indentation and @@ -506,5 +506,4 @@ JavaScript style For details about the JavaScript code style used by Django, see :doc:`javascript`. -.. _black: https://black.readthedocs.io/en/stable/ .. _editorconfig: https://editorconfig.org/ diff --git a/docs/intro/tutorial08.txt b/docs/intro/tutorial08.txt index c184eec47a..463db3221e 100644 --- a/docs/intro/tutorial08.txt +++ b/docs/intro/tutorial08.txt @@ -8,10 +8,10 @@ Django's strengths is the rich ecosystem of third-party packages. They're community developed packages that can be used to quickly improve the feature set of an application. -This tutorial will show how to add `Django Debug Toolbar -`_, a commonly used third-party -package. The Django Debug Toolbar has ranked in the top three most used -third-party packages in the Django Developers Survey in recent years. +This tutorial will show how to add :pypi:`Django Debug Toolbar +`, a commonly used third-party package. The Django Debug +Toolbar has ranked in the top three most used third-party packages in the +Django Developers Survey in recent years. .. admonition:: Where to get help: diff --git a/docs/ref/contrib/gis/geoip2.txt b/docs/ref/contrib/gis/geoip2.txt index 2be6ea516c..a4a28496f6 100644 --- a/docs/ref/contrib/gis/geoip2.txt +++ b/docs/ref/contrib/gis/geoip2.txt @@ -5,8 +5,8 @@ Geolocation with GeoIP2 .. module:: django.contrib.gis.geoip2 :synopsis: Python interface for MaxMind's GeoIP2 databases. -The :class:`GeoIP2` object is a wrapper for the `MaxMind geoip2 Python -library`__. [#]_ +The :class:`GeoIP2` object is a wrapper for the :pypi:`MaxMind geoip2 Python +library `. [#]_ In order to perform IP-based geolocation, the :class:`GeoIP2` object requires the :pypi:`geoip2` Python package and the GeoIP ``Country`` and/or ``City`` @@ -18,7 +18,6 @@ the :setting:`GEOIP_PATH` setting. Additionally, it is recommended to install the `libmaxminddb C library`__, so that ``geoip2`` can leverage the C library's faster speed. -__ https://geoip2.readthedocs.io/ __ https://dev.maxmind.com/geoip/geolite2-free-geolocation-data __ https://db-ip.com/db/lite.php __ https://github.com/maxmind/libmaxminddb/ diff --git a/docs/ref/forms/fields.txt b/docs/ref/forms/fields.txt index 2ae4fe2be6..ac1df1bd86 100644 --- a/docs/ref/forms/fields.txt +++ b/docs/ref/forms/fields.txt @@ -801,11 +801,11 @@ For each field, we describe the default widget used if you don't specify * Error message keys: ``required``, ``invalid``, ``missing``, ``empty``, ``invalid_image`` - Using an ``ImageField`` requires that `Pillow`_ is installed with support - for the image formats you use. If you encounter a ``corrupt image`` error - when you upload an image, it usually means that Pillow doesn't understand - its format. To fix this, install the appropriate library and reinstall - Pillow. + Using an ``ImageField`` requires that :pypi:`pillow` is installed with + support for the image formats you use. If you encounter a ``corrupt image`` + error when you upload an image, it usually means that Pillow doesn't + understand its format. To fix this, install the appropriate library and + reinstall Pillow. When you use an ``ImageField`` on a form, you must also remember to :ref:`bind the file data to the form `. @@ -851,7 +851,6 @@ For each field, we describe the default widget used if you don't specify image's content type if Pillow can determine it, otherwise it will be set to ``None``. -.. _Pillow: https://pillow.readthedocs.io/en/latest/ .. _Image: https://pillow.readthedocs.io/en/latest/reference/Image.html ``IntegerField`` diff --git a/docs/ref/models/fields.txt b/docs/ref/models/fields.txt index e8b1cf8cba..c83b50ab7e 100644 --- a/docs/ref/models/fields.txt +++ b/docs/ref/models/fields.txt @@ -12,8 +12,8 @@ This document contains all the API references of :class:`Field` including the .. seealso:: - If the built-in fields don't do the trick, you can try `django-localflavor - `_ (`documentation + If the built-in fields don't do the trick, you can try + :pypi:`django-localflavor` (`documentation `_), which contains assorted pieces of code that are useful for particular countries and cultures. @@ -1357,9 +1357,7 @@ following optional arguments: Name of a model field which is auto-populated with the width of the image each time an image object is set. -Requires the `Pillow`_ library. - -.. _Pillow: https://pillow.readthedocs.io/en/latest/ +Requires the :pypi:`pillow` library. :class:`ImageField` instances are created in your database as ``varchar`` columns with a default max length of 100 characters. As with other fields, you diff --git a/docs/topics/db/optimization.txt b/docs/topics/db/optimization.txt index dd252121e2..6b2733643f 100644 --- a/docs/topics/db/optimization.txt +++ b/docs/topics/db/optimization.txt @@ -14,7 +14,7 @@ As general programming practice, this goes without saying. Find out :ref:`what queries you are doing and what they are costing you `. Use :meth:`.QuerySet.explain` to understand how specific ``QuerySet``\s are executed by your database. You may also want to use an external project like -django-debug-toolbar_, or a tool that monitors your database directly. +:pypi:`django-debug-toolbar`, or a tool that monitors your database directly. Remember that you may be optimizing for speed or memory or both, depending on your requirements. Sometimes optimizing for one will be detrimental to the @@ -30,8 +30,6 @@ readability of your code. **All** of the suggestions below come with the caveat that in your circumstances the general principle might not apply, or might even be reversed. -.. _django-debug-toolbar: https://github.com/jazzband/django-debug-toolbar/ - Use standard DB optimization techniques ======================================= diff --git a/docs/topics/email.txt b/docs/topics/email.txt index b991de4d78..9be6d40aca 100644 --- a/docs/topics/email.txt +++ b/docs/topics/email.txt @@ -774,7 +774,7 @@ to a file that can be inspected at your leisure. Another approach is to use a "dumb" SMTP server that receives the emails locally and displays them to the terminal, but does not actually send -anything. The `aiosmtpd`_ package provides a way to accomplish this: +anything. The :pypi:`aiosmtpd` package provides a way to accomplish this: .. code-block:: shell diff --git a/docs/topics/i18n/translation.txt b/docs/topics/i18n/translation.txt index 273e856910..3ac254de98 100644 --- a/docs/topics/i18n/translation.txt +++ b/docs/topics/i18n/translation.txt @@ -1335,9 +1335,7 @@ whenever you restart your application server:: You can even pre-generate the JavaScript catalog as part of your deployment procedure and serve it as a static file. This radical technique is implemented -in django-statici18n_. - -.. _django-statici18n: https://django-statici18n.readthedocs.io/ +in :pypi:`django-statici18n`. .. _url-internationalization: diff --git a/docs/topics/performance.txt b/docs/topics/performance.txt index a346dc7385..cedd824e30 100644 --- a/docs/topics/performance.txt +++ b/docs/topics/performance.txt @@ -55,11 +55,10 @@ code. Django tools ~~~~~~~~~~~~ -`django-debug-toolbar -`_ is a very handy tool that -provides insights into what your code is doing and how much time it spends -doing it. In particular it can show you all the SQL queries your page is -generating, and how long each one has taken. +:pypi:`django-debug-toolbar` is a very handy tool that provides insights into +what your code is doing and how much time it spends doing it. In particular it +can show you all the SQL queries your page is generating, and how long each one +has taken. Third-party panels are also available for the toolbar, that can (for example) report on cache performance and template rendering times.