1
0
mirror of https://github.com/django/django.git synced 2025-05-20 05:46:33 +00:00

[5.2.x] Doc'd how to use Intersphinx in the reusable apps tutorial.

Backport of 6e54e20cc3908d4eb103678db14e1e02e05069dd from main.
This commit is contained in:
Carlton Gibson 2025-03-22 14:27:36 +01:00 committed by Sarah Boyce
parent 06f621f359
commit ec2af58ac6

View File

@ -264,6 +264,26 @@ this. For a small app like polls, this process isn't too difficult.
you add some files to it. Many Django apps also provide their documentation you add some files to it. Many Django apps also provide their documentation
online through sites like `readthedocs.org <https://readthedocs.org>`_. online through sites like `readthedocs.org <https://readthedocs.org>`_.
Many Python projects, including Django and Python itself, use `Sphinx
<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_ to build
their documentation. If you choose to use Sphinx you can link back to the
Django documentation by configuring `Intersphinx
<https://www.sphinx-doc.org/en/master/usage/quickstart.html#intersphinx>`_
and including a value for Django in your project's ``intersphinx_mapping``
value::
intersphinx_mapping = {
# ...
"django": (
"https://docs.djangoproject.com/en/stable/",
"https://docs.djangoproject.com/en/stable/_objects/",
),
}
With that in place, you can then cross-link to specific entries, in the
same way as in the Django docs, such as
"``:attr:`django.test.TransactionTestCase.databases```".
#. Check that the :pypi:`build` package is installed (``python -m pip install #. Check that the :pypi:`build` package is installed (``python -m pip install
build``) and try building your package by running ``python -m build`` inside build``) and try building your package by running ``python -m build`` inside
``django-polls``. This creates a directory called ``dist`` and builds your ``django-polls``. This creates a directory called ``dist`` and builds your