1
0
mirror of https://github.com/django/django.git synced 2024-12-22 17:16:24 +00:00

Used extlinks for PyPI links.

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
This commit is contained in:
Tim Graham 2023-04-16 19:14:09 -04:00 committed by Mariusz Felisiak
parent 255f534590
commit 2c4dc64760
36 changed files with 117 additions and 204 deletions

View File

@ -134,6 +134,7 @@ extlinks = {
"bpo": ("https://bugs.python.org/issue?@action=redirect&bpo=%s", "bpo-%s"), "bpo": ("https://bugs.python.org/issue?@action=redirect&bpo=%s", "bpo-%s"),
"commit": ("https://github.com/django/django/commit/%s", "%s"), "commit": ("https://github.com/django/django/commit/%s", "%s"),
"cve": ("https://nvd.nist.gov/vuln/detail/CVE-%s", "CVE-%s"), "cve": ("https://nvd.nist.gov/vuln/detail/CVE-%s", "CVE-%s"),
"pypi": ("https://pypi.org/project/%s/", "%s"),
# A file or directory. GitHub redirects from blob to tree if needed. # A file or directory. GitHub redirects from blob to tree if needed.
"source": ("https://github.com/django/django/blob/main/%s", "%s"), "source": ("https://github.com/django/django/blob/main/%s", "%s"),
"ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"), "ticket": ("https://code.djangoproject.com/ticket/%s", "#%s"),

View File

@ -2,10 +2,8 @@
How to use Django with Daphne How to use Django with Daphne
============================= =============================
Daphne_ is a pure-Python ASGI server for UNIX, maintained by members of the :pypi:`Daphne <daphne>` is a pure-Python ASGI server for UNIX, maintained by
Django project. It acts as the reference server for ASGI. members of the Django project. It acts as the reference server for ASGI.
.. _Daphne: https://pypi.org/project/daphne/
Installing Daphne Installing Daphne
=================== ===================

View File

@ -20,8 +20,8 @@ participating in a March Madness contest.
Install ReportLab Install ReportLab
================= =================
The ReportLab library is `available on PyPI`_. A `user guide`_ (not The ReportLab library is :pypi:`available on PyPI <reportlab>`. A `user guide`_
coincidentally, a PDF file) is also available for download. (not coincidentally, a PDF file) is also available for download.
You can install ReportLab with ``pip``: You can install ReportLab with ``pip``:
.. console:: .. console::
@ -36,7 +36,6 @@ Test your installation by importing it in the Python interactive interpreter:
If that command doesn't raise any errors, the installation worked. If that command doesn't raise any errors, the installation worked.
.. _available on PyPI: https://pypi.org/project/reportlab/
.. _user guide: https://www.reportlab.com/docs/reportlab-userguide.pdf .. _user guide: https://www.reportlab.com/docs/reportlab-userguide.pdf
Write your view Write your view

View File

@ -39,13 +39,11 @@ matches the version you installed by executing:
About ``pip`` About ``pip``
============= =============
`pip`_ is a package manager for Python and is included by default with the :pypi:`pip` is a package manager for Python and is included by default with the
Python installer. It helps to install and uninstall Python packages Python installer. It helps to install and uninstall Python packages
(such as Django!). For the rest of the installation, we'll use ``pip`` to (such as Django!). For the rest of the installation, we'll use ``pip`` to
install Python packages from the command line. install Python packages from the command line.
.. _pip: https://pypi.org/project/pip/
.. _virtualenvironment: .. _virtualenvironment:
Setting up a virtual environment Setting up a virtual environment
@ -105,8 +103,8 @@ terminal. In modern terminals this should work for both CMD and PowerShell. If
for some reason this needs to be disabled, set the environmental variable for some reason this needs to be disabled, set the environmental variable
:envvar:`DJANGO_COLORS` to ``nocolor``. :envvar:`DJANGO_COLORS` to ``nocolor``.
On older Windows versions, or legacy terminals, colorama_ must be installed to On older Windows versions, or legacy terminals, :pypi:`colorama` must be
enable syntax coloring: installed to enable syntax coloring:
.. code-block:: doscon .. code-block:: doscon
@ -114,8 +112,6 @@ enable syntax coloring:
See :ref:`syntax-coloring` for more information on color settings. See :ref:`syntax-coloring` for more information on color settings.
.. _colorama: https://pypi.org/project/colorama/
Common pitfalls Common pitfalls
=============== ===============

View File

@ -45,12 +45,12 @@ Python style
* Unless otherwise specified, follow :pep:`8`. * Unless otherwise specified, follow :pep:`8`.
Use `flake8`_ to check for problems in this area. Note that our ``setup.cfg`` Use :pypi:`flake8` to check for problems in this area. Note that our
file contains some excluded files (deprecated modules we don't care about ``setup.cfg`` file contains some excluded files (deprecated modules we don't
cleaning up and some third-party code that Django vendors) as well as some care about cleaning up and some third-party code that Django vendors) as well
excluded errors that we don't consider as gross violations. Remember that as some excluded errors that we don't consider as gross violations. Remember
:pep:`8` is only a guide, so respect the style of the surrounding code as a that :pep:`8` is only a guide, so respect the style of the surrounding code
primary goal. as a primary goal.
An exception to :pep:`8` is our rules on line lengths. Don't limit lines of An exception to :pep:`8` is our rules on line lengths. Don't limit lines of
code to 79 characters if it means the code looks significantly uglier or is code to 79 characters if it means the code looks significantly uglier or is
@ -352,8 +352,8 @@ Miscellaneous
documentation </topics/i18n/index>` for details. documentation </topics/i18n/index>` for details.
* Remove ``import`` statements that are no longer used when you change code. * Remove ``import`` statements that are no longer used when you change code.
`flake8`_ will identify these imports for you. If an unused import needs to :pypi:`flake8` will identify these imports for you. If an unused import needs
remain for backwards-compatibility, mark the end of with ``# NOQA`` to to remain for backwards-compatibility, mark the end of with ``# NOQA`` to
silence the flake8 warning. silence the flake8 warning.
* Systematically remove all trailing whitespaces from your code as those * Systematically remove all trailing whitespaces from your code as those
@ -376,4 +376,3 @@ For details about the JavaScript code style used by Django, see
.. _black: https://black.readthedocs.io/en/stable/ .. _black: https://black.readthedocs.io/en/stable/
.. _editorconfig: https://editorconfig.org/ .. _editorconfig: https://editorconfig.org/
.. _flake8: https://pypi.org/project/flake8/

View File

@ -251,7 +251,7 @@ Running the Selenium tests
-------------------------- --------------------------
Some tests require Selenium and a web browser. To run these tests, you must Some tests require Selenium and a web browser. To run these tests, you must
install the selenium_ package and run the tests with the install the :pypi:`selenium` package and run the tests with the
``--selenium=<BROWSERS>`` option. For example, if you have Firefox and Google ``--selenium=<BROWSERS>`` option. For example, if you have Firefox and Google
Chrome installed: Chrome installed:
@ -277,28 +277,31 @@ Running all the tests
If you want to run the full suite of tests, you'll need to install a number of If you want to run the full suite of tests, you'll need to install a number of
dependencies: dependencies:
* aiosmtpd_ * :pypi:`aiosmtpd`
* argon2-cffi_ 19.2.0+ * :pypi:`argon2-cffi` 19.2.0+
* asgiref_ 3.6.0+ (required) * :pypi:`asgiref` 3.6.0+ (required)
* bcrypt_ * :pypi:`bcrypt`
* colorama_ * :pypi:`colorama`
* docutils_ * :pypi:`docutils`
* geoip2_ * :pypi:`geoip2`
* jinja2_ 2.11+ * :pypi:`Jinja2` 2.11+
* numpy_ * :pypi:`numpy`
* Pillow_ 6.2.1+ * :pypi:`Pillow` 6.2.1+
* PyYAML_ * :pypi:`PyYAML`
* pytz_ (required) * :pypi:`pytz` (required)
* pywatchman_ * :pypi:`pywatchman`
* redis_ 3.4+ * :pypi:`redis` 3.4+
* setuptools_ * :pypi:`setuptools`
* memcached_, plus a :ref:`supported Python binding <memcached>` * :pypi:`memcached`, plus a `supported Python binding
* gettext_ (:ref:`gettext_on_windows`) <https://memcached.org/>`_
* selenium_ * `gettext <https://www.gnu.org/software/gettext/manual/gettext.html>`_
* sqlparse_ 0.3.1+ (required) (:ref:`gettext_on_windows`)
* tblib_ 1.5.0+ * :pypi:`selenium`
* :pypi:`sqlparse` 0.3.1+ (required)
* :pypi:`tblib` 1.5.0+
You can find these dependencies in `pip requirements files`_ inside the You can find these dependencies in `pip requirements files
<https://pip.pypa.io/en/latest/user_guide/#requirements-files>`_ inside the
``tests/requirements`` directory of the Django source tree and install them ``tests/requirements`` directory of the Django source tree and install them
like so: like so:
@ -324,31 +327,8 @@ and install the Geospatial libraries</ref/contrib/gis/install/index>`.
Each of these dependencies is optional. If you're missing any of them, the Each of these dependencies is optional. If you're missing any of them, the
associated tests will be skipped. associated tests will be skipped.
To run some of the autoreload tests, you'll need to install the Watchman_ To run some of the autoreload tests, you'll need to install the
service. `Watchman <https://facebook.github.io/watchman/>`_ service.
.. _aiosmtpd: https://pypi.org/project/aiosmtpd/
.. _argon2-cffi: https://pypi.org/project/argon2-cffi/
.. _asgiref: https://pypi.org/project/asgiref/
.. _bcrypt: https://pypi.org/project/bcrypt/
.. _colorama: https://pypi.org/project/colorama/
.. _docutils: https://pypi.org/project/docutils/
.. _geoip2: https://pypi.org/project/geoip2/
.. _jinja2: https://pypi.org/project/Jinja2/
.. _numpy: https://pypi.org/project/numpy/
.. _Pillow: https://pypi.org/project/Pillow/
.. _PyYAML: https://pyyaml.org/wiki/PyYAML
.. _pytz: https://pypi.org/project/pytz/
.. _pywatchman: https://pypi.org/project/pywatchman/
.. _redis: https://pypi.org/project/redis/
.. _setuptools: https://pypi.org/project/setuptools/
.. _memcached: https://memcached.org/
.. _gettext: https://www.gnu.org/software/gettext/manual/gettext.html
.. _selenium: https://pypi.org/project/selenium/
.. _sqlparse: https://pypi.org/project/sqlparse/
.. _pip requirements files: https://pip.pypa.io/en/latest/user_guide/#requirements-files
.. _tblib: https://pypi.org/project/tblib/
.. _Watchman: https://facebook.github.io/watchman/
Code coverage Code coverage
------------- -------------

View File

@ -211,7 +211,7 @@ documentation:
"last bit" of that path. So ``:mod:`~django.contrib.auth``` will "last bit" of that path. So ``:mod:`~django.contrib.auth``` will
display a link with the title "auth". display a link with the title "auth".
* All Python code blocks should be formatted using the `blacken-docs`_ * All Python code blocks should be formatted using the :pypi:`blacken-docs`
auto-formatter. This will be run by ``pre-commit`` if that is configured. auto-formatter. This will be run by ``pre-commit`` if that is configured.
* Use :mod:`~sphinx.ext.intersphinx` to reference Python's and Sphinx' * Use :mod:`~sphinx.ext.intersphinx` to reference Python's and Sphinx'
@ -264,9 +264,7 @@ documentation:
.. versionchanged:: 4.2 .. versionchanged:: 4.2
All Python code blocks in the Django documentation were reformatted with All Python code blocks in the Django documentation were reformatted with
`blacken-docs`_. :pypi:`blacken-docs`.
.. _blacken-docs: https://pypi.org/project/blacken-docs/
Django-specific markup Django-specific markup
====================== ======================
@ -536,8 +534,7 @@ Spelling check
============== ==============
Before you commit your docs, it's a good idea to run the spelling checker. Before you commit your docs, it's a good idea to run the spelling checker.
You'll need to install `sphinxcontrib-spelling You'll need to install :pypi:`sphinxcontrib-spelling` first. Then from the
<https://pypi.org/project/sphinxcontrib-spelling/>`_ first. Then from the
``docs`` directory, run ``make spelling``. Wrong words (if any) along with the ``docs`` directory, run ``make spelling``. Wrong words (if any) along with the
file and line number where they occur will be saved to file and line number where they occur will be saved to
``_build/spelling/output.txt``. ``_build/spelling/output.txt``.

View File

@ -109,15 +109,15 @@ Role
---- ----
Releasers_ are a small set of people who have the authority to upload packaged Releasers_ are a small set of people who have the authority to upload packaged
releases of Django to the `Python Package Index`_, and to the releases of Django to the :pypi:`Python Package Index <Django>` and to the
`djangoproject.com`_ website. `djangoproject.com`_ website.
Prerogatives Prerogatives
------------ ------------
Releasers_ :doc:`build Django releases </internals/howto-release-django>` and Releasers_ :doc:`build Django releases </internals/howto-release-django>` and
upload them to the `Python Package Index`_, and to the `djangoproject.com`_ upload them to the :pypi:`Python Package Index <Django>` and to the
website. `djangoproject.com`_ website.
Membership Membership
---------- ----------
@ -155,7 +155,6 @@ Otherwise, a Releaser may be removed by:
of the Django Software Foundation. of the Django Software Foundation.
- A vote of the steering council. - A vote of the steering council.
.. _`Python Package Index`: https://pypi.org/project/Django/
.. _djangoproject.com: https://www.djangoproject.com/download/ .. _djangoproject.com: https://www.djangoproject.com/download/
.. _steering-council: .. _steering-council:

View File

@ -121,9 +121,10 @@ On the day of disclosure, we will take the following steps:
#. Apply the relevant patch(es) to Django's codebase. #. Apply the relevant patch(es) to Django's codebase.
#. Issue the relevant release(s), by placing new packages on `the #. Issue the relevant release(s), by placing new packages on the :pypi:`Python
Python Package Index`_ and on the Django website, and tagging the Package Index <Django>` and on the `djangoproject.com website
new release(s) in Django's git repository. <https://www.djangoproject.com/download/>`_, and tagging the new release(s)
in Django's git repository.
#. Post a public entry on `the official Django development blog`_, #. Post a public entry on `the official Django development blog`_,
describing the issue and its resolution in detail, pointing to the describing the issue and its resolution in detail, pointing to the
@ -133,7 +134,6 @@ On the day of disclosure, we will take the following steps:
#. Post a notice to the |django-announce| and oss-security@lists.openwall.com #. Post a notice to the |django-announce| and oss-security@lists.openwall.com
mailing lists that links to the blog post. mailing lists that links to the blog post.
.. _the Python Package Index: https://pypi.org/
.. _the official Django development blog: https://www.djangoproject.com/weblog/ .. _the official Django development blog: https://www.djangoproject.com/weblog/
If a reported issue is believed to be particularly time-sensitive -- If a reported issue is believed to be particularly time-sensitive --

View File

@ -107,16 +107,13 @@ Installing some prerequisites
============================= =============================
The current state of Python packaging is a bit muddled with various tools. For The current state of Python packaging is a bit muddled with various tools. For
this tutorial, we're going to use setuptools_ to build our package. It's the this tutorial, we're going to use :pypi:`setuptools` to build our package. It's
recommended packaging tool (merged with the ``distribute`` fork). We'll also be the recommended packaging tool (merged with the ``distribute`` fork). We'll
using `pip`_ to install and uninstall it. You should install these also be using :pypi:`pip` to install and uninstall it. You should install these
two packages now. If you need help, you can refer to :ref:`how to install two packages now. If you need help, you can refer to :ref:`how to install
Django with pip<installing-official-release>`. You can install ``setuptools`` Django with pip<installing-official-release>`. You can install ``setuptools``
the same way. the same way.
.. _setuptools: https://pypi.org/project/setuptools/
.. _pip: https://pypi.org/project/pip/
Packaging your app Packaging your app
================== ==================

View File

@ -9,7 +9,7 @@ The :class:`GeoIP2` object is a wrapper for the `MaxMind geoip2 Python
library`__. [#]_ library`__. [#]_
In order to perform IP-based geolocation, the :class:`GeoIP2` object requires In order to perform IP-based geolocation, the :class:`GeoIP2` object requires
the `geoip2 Python library`__ and the GeoIP ``Country`` and/or ``City`` the :pypi:`geoip2` Python package and the GeoIP ``Country`` and/or ``City``
datasets in binary format (the CSV files will not work!), downloaded from e.g. datasets in binary format (the CSV files will not work!), downloaded from e.g.
`MaxMind`__ or `DB-IP`__ websites. Grab the ``GeoLite2-Country.mmdb.gz`` and `MaxMind`__ or `DB-IP`__ websites. Grab the ``GeoLite2-Country.mmdb.gz`` and
``GeoLite2-City.mmdb.gz`` files and unzip them in a directory corresponding to ``GeoLite2-City.mmdb.gz`` files and unzip them in a directory corresponding to
@ -19,7 +19,6 @@ Additionally, it is recommended to install the `libmaxminddb C library`__, so
that ``geoip2`` can leverage the C library's faster speed. that ``geoip2`` can leverage the C library's faster speed.
__ https://geoip2.readthedocs.io/ __ https://geoip2.readthedocs.io/
__ https://pypi.org/project/geoip2/
__ https://dev.maxmind.com/geoip/geolite2-free-geolocation-data __ https://dev.maxmind.com/geoip/geolite2-free-geolocation-data
__ https://db-ip.com/db/lite.php __ https://db-ip.com/db/lite.php
__ https://github.com/maxmind/libmaxminddb/ __ https://github.com/maxmind/libmaxminddb/

View File

@ -448,12 +448,11 @@ MySQL DB API Drivers
MySQL has a couple drivers that implement the Python Database API described in MySQL has a couple drivers that implement the Python Database API described in
:pep:`249`: :pep:`249`:
- `mysqlclient`_ is a native driver. It's **the recommended choice**. - :pypi:`mysqlclient` is a native driver. It's **the recommended choice**.
- `MySQL Connector/Python`_ is a pure Python driver from Oracle that does not - `MySQL Connector/Python`_ is a pure Python driver from Oracle that does not
require the MySQL client library or any Python modules outside the standard require the MySQL client library or any Python modules outside the standard
library. library.
.. _mysqlclient: https://pypi.org/project/mysqlclient/
.. _MySQL Connector/Python: https://dev.mysql.com/downloads/connector/python/ .. _MySQL Connector/Python: https://dev.mysql.com/downloads/connector/python/
These drivers are thread-safe and provide connection pooling. These drivers are thread-safe and provide connection pooling.
@ -1176,21 +1175,14 @@ Using a 3rd-party database backend
In addition to the officially supported databases, there are backends provided In addition to the officially supported databases, there are backends provided
by 3rd parties that allow you to use other databases with Django: by 3rd parties that allow you to use other databases with Django:
* `CockroachDB`_ * :pypi:`CockroachDB <django-cockroachdb>`
* `Firebird`_ * :pypi:`Firebird <django-firebird>`
* `Google Cloud Spanner`_ * :pypi:`Google Cloud Spanner <django-google-spanner>`
* `Microsoft SQL Server`_ * :pypi:`Microsoft SQL Server <mssql-django>`
* `TiDB`_ * :pypi:`TiDB <django-tidb>`
* `YugabyteDB`_ * :pypi:`YugabyteDB <django-yugabytedb>`
The Django versions and ORM features supported by these unofficial backends The Django versions and ORM features supported by these unofficial backends
vary considerably. Queries regarding the specific capabilities of these vary considerably. Queries regarding the specific capabilities of these
unofficial backends, along with any support queries, should be directed to unofficial backends, along with any support queries, should be directed to
the support channels provided by each 3rd party project. the support channels provided by each 3rd party project.
.. _CockroachDB: https://pypi.org/project/django-cockroachdb/
.. _Firebird: https://pypi.org/project/django-firebird/
.. _Google Cloud Spanner: https://pypi.org/project/django-google-spanner/
.. _Microsoft SQL Server: https://pypi.org/project/mssql-django/
.. _TiDB: https://pypi.org/project/django-tidb/
.. _YugabyteDB: https://pypi.org/project/django-yugabytedb/

View File

@ -881,7 +881,7 @@ needed. You don't need to restart the server for code changes to take effect.
However, some actions like adding files don't trigger a restart, so you'll However, some actions like adding files don't trigger a restart, so you'll
have to restart the server in these cases. have to restart the server in these cases.
If you're using Linux or MacOS and install both `pywatchman`_ and the If you're using Linux or MacOS and install both :pypi:`pywatchman` and the
`Watchman`_ service, kernel signals will be used to autoreload the server `Watchman`_ service, kernel signals will be used to autoreload the server
(rather than polling file modification timestamps each second). This offers (rather than polling file modification timestamps each second). This offers
better performance on large projects, reduced response time after code changes, better performance on large projects, reduced response time after code changes,
@ -903,7 +903,6 @@ more robust change detection, and a reduction in power usage. Django supports
by setting the :envvar:`DJANGO_WATCHMAN_TIMEOUT` environment variable. by setting the :envvar:`DJANGO_WATCHMAN_TIMEOUT` environment variable.
.. _Watchman: https://facebook.github.io/watchman/ .. _Watchman: https://facebook.github.io/watchman/
.. _pywatchman: https://pypi.org/project/pywatchman/
.. _watchman documentation: https://facebook.github.io/watchman/docs/config#ignore_dirs .. _watchman documentation: https://facebook.github.io/watchman/docs/config#ignore_dirs
When you start the server, and each time you change Python code while the When you start the server, and each time you change Python code while the
@ -1920,9 +1919,9 @@ Under Windows, the legacy ``cmd.exe`` native console doesn't support ANSI
escape sequences so by default there is no color output. In this case either of escape sequences so by default there is no color output. In this case either of
two third-party libraries are needed: two third-party libraries are needed:
* Install colorama_, a Python package that translates ANSI color codes into * Install :pypi:`colorama`, a Python package that translates ANSI color codes
Windows API calls. Django commands will detect its presence and will make use into Windows API calls. Django commands will detect its presence and will
of its services to color output just like on Unix-based platforms. make use of its services to color output just like on Unix-based platforms.
``colorama`` can be installed via pip: ``colorama`` can be installed via pip:
.. code-block:: doscon .. code-block:: doscon
@ -1941,7 +1940,6 @@ installation of ``ANSICON`` by setting the appropriate environmental variable,
.. _`Windows Terminal`: https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701 .. _`Windows Terminal`: https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701
.. _`VS Code`: https://code.visualstudio.com .. _`VS Code`: https://code.visualstudio.com
.. _ANSICON: http://adoxa.altervista.org/ansicon/ .. _ANSICON: http://adoxa.altervista.org/ansicon/
.. _colorama: https://pypi.org/project/colorama/
Custom colors Custom colors
~~~~~~~~~~~~~ ~~~~~~~~~~~~~

View File

@ -698,8 +698,8 @@ escaping HTML.
If ``value`` is ``"<b>Joel</b> <button>is</button> a <span>slug</span>"`` If ``value`` is ``"<b>Joel</b> <button>is</button> a <span>slug</span>"``
the return value will be ``"Joel is a slug"``. the return value will be ``"Joel is a slug"``.
If you are looking for a more robust solution, take a look at the `bleach If you are looking for a more robust solution, take a look at the
<https://pypi.org/project/bleach/>`_ Python library. :pypi:`bleach` Python package.
.. function:: html_safe() .. function:: html_safe()

View File

@ -579,8 +579,7 @@ It's automatically installed along with Django.
Support for ``settings.TIME_ZONE = None`` is removed as the behavior isn't Support for ``settings.TIME_ZONE = None`` is removed as the behavior isn't
commonly used and is questionably useful. If you want to automatically detect commonly used and is questionably useful. If you want to automatically detect
the timezone based on the system timezone, you can use `tzlocal the timezone based on the system timezone, you can use :pypi:`tzlocal`::
<https://pypi.org/project/tzlocal/>`_::
from tzlocal import get_localzone from tzlocal import get_localzone

View File

@ -112,8 +112,8 @@ for more details or learn how to :doc:`manage static files
Python 2.7 introduced some major changes to the ``unittest`` library, Python 2.7 introduced some major changes to the ``unittest`` library,
adding some extremely useful features. To ensure that every Django adding some extremely useful features. To ensure that every Django
project can benefit from these new features, Django ships with a copy project can benefit from these new features, Django ships with a copy
of unittest2_, a copy of the Python 2.7 ``unittest`` library, backported of :pypi:`unittest2`, a copy of the Python 2.7 ``unittest`` library,
for Python 2.4 compatibility. backported for Python 2.4 compatibility.
To access this library, Django provides the ``django.utils.unittest`` To access this library, Django provides the ``django.utils.unittest``
module alias. If you are using Python 2.7, or you have installed module alias. If you are using Python 2.7, or you have installed
@ -132,8 +132,6 @@ wherever you would have historically used::
If you want to continue to use the base ``unittest`` library, you can -- If you want to continue to use the base ``unittest`` library, you can --
you just won't get any of the nice new ``unittest2`` features. you just won't get any of the nice new ``unittest2`` features.
.. _unittest2: https://pypi.org/project/unittest2/
Transaction context managers Transaction context managers
---------------------------- ----------------------------

View File

@ -599,9 +599,8 @@ Django 1.4 also includes several smaller improvements worth noting:
for more information. for more information.
* The :djadmin:`makemessages` command uses a new and more accurate lexer, * The :djadmin:`makemessages` command uses a new and more accurate lexer,
`JsLex`_, for extracting translatable strings from JavaScript files. :pypi:`JsLex <jslex>`, for extracting translatable strings from JavaScript
files.
.. _JsLex: https://pypi.org/project/jslex/
* The :ttag:`trans` template tag now takes an optional ``as`` argument to * The :ttag:`trans` template tag now takes an optional ``as`` argument to
be able to retrieve a translation string without displaying it but setting be able to retrieve a translation string without displaying it but setting

View File

@ -257,12 +257,10 @@ Minor features
* Added ``BCryptSHA256PasswordHasher`` to resolve the password truncation issue * Added ``BCryptSHA256PasswordHasher`` to resolve the password truncation issue
with bcrypt. with bcrypt.
* `Pillow`_ is now the preferred image manipulation library to use with Django. * :pypi:`Pillow` is now the preferred image manipulation library to use with
`PIL`_ is pending deprecation (support to be removed in Django 1.8). Django. :pypi:`PIL` is pending deprecation (support to be removed in Django
To upgrade, you should **first** uninstall PIL, **then** install Pillow. 1.8). To upgrade, you should **first** uninstall PIL, **then** install
Pillow.
.. _`Pillow`: https://pypi.org/project/Pillow/
.. _`PIL`: https://pypi.org/project/PIL/
* :class:`~django.forms.ModelForm` accepts several new ``Meta`` * :class:`~django.forms.ModelForm` accepts several new ``Meta``
options. options.

View File

@ -715,13 +715,11 @@ Management Commands
* The :djadmin:`runserver` command received several improvements: * The :djadmin:`runserver` command received several improvements:
* On Linux systems, if pyinotify_ is installed, the development server will * On Linux systems, if :pypi:`pyinotify` is installed, the development server
reload immediately when a file is changed. Previously, it polled the will reload immediately when a file is changed. Previously, it polled the
filesystem for changes every second. That caused a small delay before filesystem for changes every second. That caused a small delay before
reloads and reduced battery life on laptops. reloads and reduced battery life on laptops.
.. _pyinotify: https://pypi.org/project/pyinotify/
* In addition, the development server automatically reloads when a * In addition, the development server automatically reloads when a
translation file is updated, i.e. after running translation file is updated, i.e. after running
:djadmin:`compilemessages`. :djadmin:`compilemessages`.
@ -735,15 +733,13 @@ Management Commands
* :djadmin:`collectstatic` command with symlink option is now supported on * :djadmin:`collectstatic` command with symlink option is now supported on
Windows NT 6 (Windows Vista and newer). Windows NT 6 (Windows Vista and newer).
* Initial SQL data now works better if the sqlparse_ Python library is * Initial SQL data now works better if the :pypi:`sqlparse` Python library is
installed. installed.
Note that it's deprecated in favor of the Note that it's deprecated in favor of the
:class:`~django.db.migrations.operations.RunSQL` operation of migrations, :class:`~django.db.migrations.operations.RunSQL` operation of migrations,
which benefits from the improved behavior. which benefits from the improved behavior.
.. _sqlparse: https://pypi.org/project/sqlparse/
Models Models
~~~~~~ ~~~~~~
@ -1207,11 +1203,9 @@ details.
------------------------ ------------------------
If your project handles datetimes before 1970 or after 2037 and Django raises If your project handles datetimes before 1970 or after 2037 and Django raises
a :exc:`ValueError` when encountering them, you will have to install pytz_. You a :exc:`ValueError` when encountering them, you will have to install
may be affected by this problem if you use Django's time zone-related date :pypi:`pytz`. You may be affected by this problem if you use Django's time
formats or :mod:`django.contrib.syndication`. zone-related date formats or :mod:`django.contrib.syndication`.
.. _pytz: https://pypi.org/project/pytz/
``remove()`` and ``clear()`` methods of related managers ``remove()`` and ``clear()`` methods of related managers
-------------------------------------------------------- --------------------------------------------------------

View File

@ -64,14 +64,12 @@ upgrade instructions in older versions of the documentation.
Security enhancements Security enhancements
--------------------- ---------------------
Several features of the django-secure_ third-party library have been Several features of the :pypi:`django-secure` third-party library have been
integrated into Django. :class:`django.middleware.security.SecurityMiddleware` integrated into Django. :class:`django.middleware.security.SecurityMiddleware`
provides several security enhancements to the request/response cycle. The new provides several security enhancements to the request/response cycle. The new
:option:`check --deploy` option allows you to check your production settings :option:`check --deploy` option allows you to check your production settings
file for ways to increase the security of your site. file for ways to increase the security of your site.
.. _django-secure: https://pypi.org/project/django-secure/
New PostgreSQL specific functionality New PostgreSQL specific functionality
------------------------------------- -------------------------------------
@ -1506,9 +1504,7 @@ in your project.
The ``django.utils.checksums`` module has been deprecated and will be removed The ``django.utils.checksums`` module has been deprecated and will be removed
in Django 1.10. The functionality it provided (validating checksum using the in Django 1.10. The functionality it provided (validating checksum using the
Luhn algorithm) was undocumented and not used in Django. The module has been Luhn algorithm) was undocumented and not used in Django. The module has been
moved to the `django-localflavor`_ package (version 1.1+). moved to the :pypi:`django-localflavor` package (version 1.1+).
.. _django-localflavor: https://pypi.org/project/django-localflavor/
``InlineAdminForm.original_content_type_id`` ``InlineAdminForm.original_content_type_id``
-------------------------------------------- --------------------------------------------

View File

@ -37,11 +37,9 @@ after a database transaction is successfully committed. This is useful for
tasks such as sending notification emails, creating queued tasks, or tasks such as sending notification emails, creating queued tasks, or
invalidating caches. invalidating caches.
This functionality from the `django-transaction-hooks`_ package has been This functionality from the :pypi:`django-transaction-hooks` package has been
integrated into Django. integrated into Django.
.. _django-transaction-hooks: https://pypi.org/project/django-transaction-hooks/
Password validation Password validation
------------------- -------------------

View File

@ -408,8 +408,8 @@ Miscellaneous
suitable alternatives. Compared to the ``QUERY_TERMS`` constant, they allow suitable alternatives. Compared to the ``QUERY_TERMS`` constant, they allow
your code to also account for any custom lookups that have been registered. your code to also account for any custom lookups that have been registered.
* Compatibility with ``py-bcrypt`` is removed as it's unmaintained. Use `bcrypt * Compatibility with ``py-bcrypt`` is removed as it's unmaintained. Use
<https://pypi.org/project/bcrypt/>`_ instead. :pypi:`bcrypt` instead.
.. _deprecated-features-2.1: .. _deprecated-features-2.1:

View File

@ -333,9 +333,9 @@ change shouldn't have an impact on your tests unless you've customized
``sqlparse`` is required dependency ``sqlparse`` is required dependency
----------------------------------- -----------------------------------
To simplify a few parts of Django's database handling, `sqlparse 0.2.2+ To simplify a few parts of Django's database handling, :pypi:`sqlparse 0.2.2+
<https://pypi.org/project/sqlparse/>`_ is now a required dependency. It's <sqlparse>` is now a required dependency. It's automatically installed along
automatically installed along with Django. with Django.
``cached_property`` aliases ``cached_property`` aliases
--------------------------- ---------------------------

View File

@ -497,7 +497,7 @@ Django 3.0, we're removing these APIs at this time.
Python 3. Python 3.
* ``django.utils.six`` - Remove usage of this vendored library or switch to * ``django.utils.six`` - Remove usage of this vendored library or switch to
`six <https://pypi.org/project/six/>`_. :pypi:`six`.
* ``django.utils.encoding.python_2_unicode_compatible()`` - Alias of * ``django.utils.encoding.python_2_unicode_compatible()`` - Alias of
``six.python_2_unicode_compatible()``. ``six.python_2_unicode_compatible()``.

View File

@ -143,11 +143,9 @@ Functional indexes are added to models using the
---------------------- ----------------------
The new ``django.core.cache.backends.memcached.PyMemcacheCache`` cache backend The new ``django.core.cache.backends.memcached.PyMemcacheCache`` cache backend
allows using the pymemcache_ library for memcached. ``pymemcache`` 3.4.0 or allows using the :pypi:`pymemcache` library for memcached. ``pymemcache`` 3.4.0
higher is required. For more details, see the :doc:`documentation on caching in or higher is required. For more details, see the :doc:`documentation on caching
Django </topics/cache>`. in Django </topics/cache>`.
.. _pymemcache: https://pypi.org/project/pymemcache/
New decorators for the admin site New decorators for the admin site
--------------------------------- ---------------------------------

View File

@ -5,9 +5,7 @@ Django 4.0.3 release notes
*March 1, 2022* *March 1, 2022*
Django 4.0.3 fixes several bugs in 4.0.2. Also, all Python code in Django is Django 4.0.3 fixes several bugs in 4.0.2. Also, all Python code in Django is
reformatted with `black`_. reformatted with :pypi:`black`.
.. _black: https://pypi.org/project/black/
Bugfixes Bugfixes
======== ========

View File

@ -109,11 +109,9 @@ Redis cache backend
------------------- -------------------
The new ``django.core.cache.backends.redis.RedisCache`` cache backend provides The new ``django.core.cache.backends.redis.RedisCache`` cache backend provides
built-in support for caching with Redis. `redis-py`_ 3.0.0 or higher is built-in support for caching with Redis. :pypi:`redis-py <redis>` 3.0.0 or
required. For more details, see the :ref:`documentation on caching with Redis higher is required. For more details, see the :ref:`documentation on caching
in Django <redis>`. with Redis in Django <redis>`.
.. _`redis-py`: https://pypi.org/project/redis/
Template based form rendering Template based form rendering
----------------------------- -----------------------------

View File

@ -35,7 +35,7 @@ Psycopg 3 support
----------------- -----------------
Django now supports `psycopg`_ version 3.1.8 or higher. To update your code, Django now supports `psycopg`_ version 3.1.8 or higher. To update your code,
install the `psycopg library`_, you don't need to change the install the :pypi:`psycopg library <psycopg>`, you don't need to change the
:setting:`ENGINE <DATABASE-ENGINE>` as ``django.db.backends.postgresql`` :setting:`ENGINE <DATABASE-ENGINE>` as ``django.db.backends.postgresql``
supports both libraries. supports both libraries.
@ -47,7 +47,6 @@ As a consequence, you may need to make some changes to account for
`differences from psycopg2`_. `differences from psycopg2`_.
.. _psycopg: https://www.psycopg.org/psycopg3/ .. _psycopg: https://www.psycopg.org/psycopg3/
.. _psycopg library: https://pypi.org/project/psycopg/
.. _differences from psycopg2: https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html .. _differences from psycopg2: https://www.psycopg.org/psycopg3/docs/basic/from_pg2.html
Comments on columns and tables Comments on columns and tables
@ -459,8 +458,8 @@ Miscellaneous
* The minimum supported version of ``jinja2`` is increased from 2.9.2 to * The minimum supported version of ``jinja2`` is increased from 2.9.2 to
2.11.0. 2.11.0.
* The minimum supported version of `redis-py`_ is increased from 3.0.0 to * The minimum supported version of :pypi:`redis-py <redis>` is increased from
3.4.0. 3.0.0 to 3.4.0.
* Manually instantiated ``WSGIRequest`` objects must be provided a file-like * Manually instantiated ``WSGIRequest`` objects must be provided a file-like
object for ``wsgi.input``. Previously, Django was more lax than the expected object for ``wsgi.input``. Previously, Django was more lax than the expected
@ -468,8 +467,6 @@ Miscellaneous
* Support for ``PROJ`` < 5 is removed. * Support for ``PROJ`` < 5 is removed.
.. _`redis-py`: https://pypi.org/project/redis/
.. _deprecated-features-4.2: .. _deprecated-features-4.2:
Features deprecated in 4.2 Features deprecated in 4.2

View File

@ -234,12 +234,10 @@ context, or vice-versa. For this there are two adapter functions, from the
are used to transition between the calling styles while preserving are used to transition between the calling styles while preserving
compatibility. compatibility.
These adapter functions are widely used in Django. The `asgiref`_ package These adapter functions are widely used in Django. The :pypi:`asgiref` package
itself is part of the Django project, and it is automatically installed as a itself is part of the Django project, and it is automatically installed as a
dependency when you install Django with ``pip``. dependency when you install Django with ``pip``.
.. _asgiref: https://pypi.org/project/asgiref/
``async_to_sync()`` ``async_to_sync()``
------------------- -------------------

View File

@ -1356,8 +1356,7 @@ implementation details see :ref:`using-the-views`.
difference between the duration of a reset request for an existing difference between the duration of a reset request for an existing
email address and the duration of a reset request for a nonexistent email address and the duration of a reset request for a nonexistent
email address. To reduce the overhead, you can use a 3rd party package email address. To reduce the overhead, you can use a 3rd party package
that allows to send emails asynchronously, e.g. `django-mailer that allows to send emails asynchronously, e.g. :pypi:`django-mailer`.
<https://pypi.org/project/django-mailer/>`_.
**Attributes:** **Attributes:**

View File

@ -94,7 +94,7 @@ use of Argon2 rather than the other algorithms supported by Django.
To use Argon2id as your default storage algorithm, do the following: To use Argon2id as your default storage algorithm, do the following:
#. Install the `argon2-cffi library`_. This can be done by running #. Install the :pypi:`argon2-cffi` package. This can be done by running
``python -m pip install django[argon2]``, which is equivalent to ``python -m pip install django[argon2]``, which is equivalent to
``python -m pip install argon2-cffi`` (along with any version requirement ``python -m pip install argon2-cffi`` (along with any version requirement
from Django's ``setup.cfg``). from Django's ``setup.cfg``).
@ -125,7 +125,7 @@ use it Django supports bcrypt with minimal effort.
To use Bcrypt as your default storage algorithm, do the following: To use Bcrypt as your default storage algorithm, do the following:
#. Install the `bcrypt library`_. This can be done by running #. Install the :pypi:`bcrypt` package. This can be done by running
``python -m pip install django[bcrypt]``, which is equivalent to ``python -m pip install django[bcrypt]``, which is equivalent to
``python -m pip install bcrypt`` (along with any version requirement from ``python -m pip install bcrypt`` (along with any version requirement from
Django's ``setup.cfg``). Django's ``setup.cfg``).
@ -416,8 +416,6 @@ Include any other hashers that your site uses in this list.
.. _pbkdf2: https://en.wikipedia.org/wiki/PBKDF2 .. _pbkdf2: https://en.wikipedia.org/wiki/PBKDF2
.. _nist: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf .. _nist: https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-132.pdf
.. _bcrypt: https://en.wikipedia.org/wiki/Bcrypt .. _bcrypt: https://en.wikipedia.org/wiki/Bcrypt
.. _`bcrypt library`: https://pypi.org/project/bcrypt/
.. _`argon2-cffi library`: https://pypi.org/project/argon2-cffi/
.. _argon2: https://en.wikipedia.org/wiki/Argon2 .. _argon2: https://en.wikipedia.org/wiki/Argon2
.. _scrypt: https://en.wikipedia.org/wiki/Scrypt .. _scrypt: https://en.wikipedia.org/wiki/Scrypt
.. _`Password Hashing Competition`: https://www.password-hashing.net/ .. _`Password Hashing Competition`: https://www.password-hashing.net/

View File

@ -78,10 +78,7 @@ database or filesystem usage.
After installing Memcached itself, you'll need to install a Memcached After installing Memcached itself, you'll need to install a Memcached
binding. There are several Python Memcached bindings available; the binding. There are several Python Memcached bindings available; the
two supported by Django are `pylibmc`_ and `pymemcache`_. two supported by Django are :pypi:`pylibmc` and :pypi:`pymemcache`.
.. _`pylibmc`: https://pypi.org/project/pylibmc/
.. _`pymemcache`: https://pypi.org/project/pymemcache/
To use Memcached with Django: To use Memcached with Django:
@ -180,11 +177,8 @@ need a Redis server running either locally or on a remote machine.
__ https://redis.io/ __ https://redis.io/
After setting up the Redis server, you'll need to install Python bindings for After setting up the Redis server, you'll need to install Python bindings for
Redis. `redis-py`_ is the binding supported natively by Django. Installing the Redis. :pypi:`redis-py <redis>` is the binding supported natively by Django.
additional `hiredis-py`_ package is also recommended. Installing the :pypi:`hiredis-py <hiredis>` package is also recommended.
.. _`redis-py`: https://pypi.org/project/redis/
.. _`hiredis-py`: https://pypi.org/project/hiredis/
To use Redis as your cache backend with Django: To use Redis as your cache backend with Django:

View File

@ -14,7 +14,7 @@ and cultures.
* `GitHub <https://github.com/django/django-localflavor>`__ * `GitHub <https://github.com/django/django-localflavor>`__
* `Documentation <https://django-localflavor.readthedocs.io/>`__ * `Documentation <https://django-localflavor.readthedocs.io/>`__
* `PyPI <https://pypi.org/project/django-localflavor/>`__ * :pypi:`PyPI <django-localflavor>`
Comments Comments
======== ========
@ -26,7 +26,7 @@ product like Disqus.
* `GitHub <https://github.com/django/django-contrib-comments>`__ * `GitHub <https://github.com/django/django-contrib-comments>`__
* `Documentation <https://django-contrib-comments.readthedocs.io/>`__ * `Documentation <https://django-contrib-comments.readthedocs.io/>`__
* `PyPI <https://pypi.org/project/django-contrib-comments/>`__ * :pypi:`PyPI <django-contrib-comments>`
Formtools Formtools
========= =========
@ -35,4 +35,4 @@ Formtools
* `GitHub <https://github.com/jazzband/django-formtools/>`__ * `GitHub <https://github.com/jazzband/django-formtools/>`__
* `Documentation <https://django-formtools.readthedocs.io/>`__ * `Documentation <https://django-formtools.readthedocs.io/>`__
* `PyPI <https://pypi.org/project/django-formtools/>`__ * :pypi:`PyPI <django-formtools>`

View File

@ -415,8 +415,7 @@ Working with lazy translation objects
The result of a ``gettext_lazy()`` call can be used wherever you would use a The result of a ``gettext_lazy()`` call can be used wherever you would use a
string (a :class:`str` object) in other Django code, but it may not work with string (a :class:`str` object) in other Django code, but it may not work with
arbitrary Python code. For example, the following won't work because the arbitrary Python code. For example, the following won't work because the
`requests <https://pypi.org/project/requests/>`_ library doesn't handle :pypi:`requests` library doesn't handle ``gettext_lazy`` objects::
``gettext_lazy`` objects::
body = gettext_lazy("I \u2764 Django") # (Unicode :heart:) body = gettext_lazy("I \u2764 Django") # (Unicode :heart:)
requests.post("https://example.com/send", data={"body": body}) requests.post("https://example.com/send", data={"body": body})

View File

@ -857,7 +857,7 @@ important part of testing applications, so it's strongly recommended to check
the coverage of your tests. the coverage of your tests.
Django can be easily integrated with `coverage.py`_, a tool for measuring code Django can be easily integrated with `coverage.py`_, a tool for measuring code
coverage of Python programs. First, `install coverage.py`_. Next, run the coverage of Python programs. First, install :pypi:`coverage`. Next, run the
following from your project folder containing ``manage.py``: following from your project folder containing ``manage.py``:
.. code-block:: shell .. code-block:: shell
@ -878,4 +878,3 @@ For more options like annotated HTML listings detailing missed lines, see the
`coverage.py`_ docs. `coverage.py`_ docs.
.. _coverage.py: https://coverage.readthedocs.io/ .. _coverage.py: https://coverage.readthedocs.io/
.. _install coverage.py: https://pypi.org/project/coverage/

View File

@ -1031,8 +1031,7 @@ port assigned by the operating system. The server's URL can be accessed with
``self.live_server_url`` during the tests. ``self.live_server_url`` during the tests.
To demonstrate how to use ``LiveServerTestCase``, let's write a Selenium test. To demonstrate how to use ``LiveServerTestCase``, let's write a Selenium test.
First of all, you need to install the `selenium package`_ into your Python First of all, you need to install the :pypi:`selenium` package:
path:
.. console:: .. console::
@ -1090,7 +1089,6 @@ example above is just a tiny fraction of what the Selenium client can do; check
out the `full reference`_ for more details. out the `full reference`_ for more details.
.. _Selenium: https://www.selenium.dev/ .. _Selenium: https://www.selenium.dev/
.. _selenium package: https://pypi.org/project/selenium/
.. _full reference: https://selenium-python.readthedocs.io/api.html .. _full reference: https://selenium-python.readthedocs.io/api.html
.. _Firefox: https://www.mozilla.com/firefox/ .. _Firefox: https://www.mozilla.com/firefox/