From 2fb602f58181fa07e416474a35fef1945a6f8df3 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Thu, 28 Mar 2019 20:32:17 -0400 Subject: [2.2.x] Used extlinks for Django's source code. Backport of a68c029e224cebe540da7447dbbd27993b4aa793 from master. --- docs/ref/contrib/flatpages.txt | 4 +--- docs/ref/contrib/gis/db-api.txt | 6 ++---- docs/ref/contrib/redirects.txt | 6 ++---- docs/ref/contrib/syndication.txt | 4 +--- docs/ref/django-admin.txt | 17 ++++++----------- docs/ref/settings.txt | 16 +++------------- docs/ref/templates/api.txt | 5 ++--- 7 files changed, 17 insertions(+), 41 deletions(-) (limited to 'docs/ref') diff --git a/docs/ref/contrib/flatpages.txt b/docs/ref/contrib/flatpages.txt index dfffb61ec6..f9126cc9e2 100644 --- a/docs/ref/contrib/flatpages.txt +++ b/docs/ref/contrib/flatpages.txt @@ -213,11 +213,9 @@ Via the Python API Flatpages are represented by a standard :doc:`Django model `, - which lives in `django/contrib/flatpages/models.py`_. You can access + which lives in :source:`django/contrib/flatpages/models.py`. You can access flatpage objects via the :doc:`Django database API `. -.. _django/contrib/flatpages/models.py: https://github.com/django/django/blob/master/django/contrib/flatpages/models.py - .. currentmodule:: django.contrib.flatpages .. admonition:: Check for duplicate flatpage URLs. diff --git a/docs/ref/contrib/gis/db-api.txt b/docs/ref/contrib/gis/db-api.txt index b70ae11067..d5ddb2564c 100644 --- a/docs/ref/contrib/gis/db-api.txt +++ b/docs/ref/contrib/gis/db-api.txt @@ -268,8 +268,8 @@ to be in the units of the field. in your field definition. For example, let's say we have a ``SouthTexasCity`` model (from the -`GeoDjango distance tests`__ ) on a *projected* coordinate system valid for cities -in southern Texas:: +:source:`GeoDjango distance tests ` ) on a +*projected* coordinate system valid for cities in southern Texas:: from django.contrib.gis.db import models @@ -303,8 +303,6 @@ both. To specify the band index of a raster input on the right hand side, a Where the band with index 2 (the third band) of the raster ``rst`` would be used for the lookup. -__ https://github.com/django/django/blob/master/tests/gis_tests/distapp/models.py - .. _compatibility-table: Compatibility Tables diff --git a/docs/ref/contrib/redirects.txt b/docs/ref/contrib/redirects.txt index 15417d6f30..a37aee8711 100644 --- a/docs/ref/contrib/redirects.txt +++ b/docs/ref/contrib/redirects.txt @@ -72,10 +72,8 @@ Via the Python API .. class:: models.Redirect Redirects are represented by a standard :doc:`Django model `, - which lives in `django/contrib/redirects/models.py`_. You can access redirect - objects via the :doc:`Django database API `. - -.. _django/contrib/redirects/models.py: https://github.com/django/django/blob/master/django/contrib/redirects/models.py + which lives in :source:`django/contrib/redirects/models.py`. You can access + redirect objects via the :doc:`Django database API `. Middleware ========== diff --git a/docs/ref/contrib/syndication.txt b/docs/ref/contrib/syndication.txt index ab3fcba5d4..d79db5a94a 100644 --- a/docs/ref/contrib/syndication.txt +++ b/docs/ref/contrib/syndication.txt @@ -892,7 +892,7 @@ The low-level framework Behind the scenes, the high-level RSS framework uses a lower-level framework for generating feeds' XML. This framework lives in a single module: -`django/utils/feedgenerator.py`_. +:source:`django/utils/feedgenerator.py`. You use this framework on your own, for lower-level feed generation. You can also create custom feed generator subclasses for use with the ``feed_type`` @@ -1006,8 +1006,6 @@ For example, to create an Atom 1.0 feed and print it to standard output:: ... -.. _django/utils/feedgenerator.py: https://github.com/django/django/blob/master/django/utils/feedgenerator.py - .. currentmodule:: django.contrib.syndication Custom feed generators diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index 152108cb82..582eabdd3b 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1185,10 +1185,9 @@ Generate squashed migration file without Django version and timestamp header. Creates a Django app directory structure for the given app name in the current directory or the given destination. -By default the directory created contains a ``models.py`` file and other app -template files. (See the `source`_ for more details.) If only the app -name is given, the app directory will be created in the current working -directory. +By default, :source:`the new directory ` contains a +``models.py`` file and other app template files. If only the app name is given, +the app directory will be created in the current working directory. If the optional destination is provided, Django will use that existing directory rather than creating a new one. You can use '.' to denote the current @@ -1260,8 +1259,6 @@ files is: byte-compile invalid ``*.py`` files, template files ending with ``.py-tpl`` will be renamed to ``.py``. -.. _source: https://github.com/django/django/tree/master/django/conf/app_template/ - ``startproject`` ---------------- @@ -1270,9 +1267,9 @@ files is: Creates a Django project directory structure for the given project name in the current directory or the given destination. -By default, the new directory contains ``manage.py`` and a project package -(containing a ``settings.py`` and other files). See the `template source`_ for -details. +By default, :source:`the new directory ` contains +``manage.py`` and a project package (containing a ``settings.py`` and other +files). If only the project name is given, both the project directory and project package will be named ```` and the project directory @@ -1315,8 +1312,6 @@ The :class:`template context ` used is: Please also see the :ref:`rendering warning ` as mentioned for :djadmin:`startapp`. -.. _`template source`: https://github.com/django/django/tree/master/django/conf/project_template/ - ``test`` -------- diff --git a/docs/ref/settings.txt b/docs/ref/settings.txt index ec733b6bef..e7a294923f 100644 --- a/docs/ref/settings.txt +++ b/docs/ref/settings.txt @@ -1160,8 +1160,6 @@ requests being returned as "Bad Request (400)". The default :file:`settings.py` file created by :djadmin:`django-admin startproject ` sets ``DEBUG = True`` for convenience. -.. _django/views/debug.py: https://github.com/django/django/blob/master/django/views/debug.py - .. setting:: DEBUG_PROPAGATE_EXCEPTIONS ``DEBUG_PROPAGATE_EXCEPTIONS`` @@ -1825,9 +1823,7 @@ deletes the one. Default: A list of all available languages. This list is continually growing and including a copy here would inevitably become rapidly out of date. You can see the current list of translated languages by looking in -``django/conf/global_settings.py`` (or view the `online source`_). - -.. _online source: https://github.com/django/django/blob/master/django/conf/global_settings.py +:source:`django/conf/global_settings.py`. The list is a list of two-tuples in the format (:term:`language code`, ``language name``) -- for example, @@ -1858,11 +1854,7 @@ Here's a sample settings file:: Default: A list of all language codes from the :setting:`LANGUAGES` setting that are written right-to-left. You can see the current list of these languages -by looking in ``django/conf/global_settings.py`` (or view the `online -source`_). - -.. _online source: https://github.com/django/django/blob/master/django/conf/global_settings.py - +by looking in :source:`django/conf/global_settings.py`. The list contains :term:`language codes` for languages that are written right-to-left. @@ -1906,9 +1898,7 @@ errors to an email log handler when :setting:`DEBUG` is ``False``. See also :ref:`configuring-logging`. You can see the default logging configuration by looking in -``django/utils/log.py`` (or view the `online source`__). - -__ https://github.com/django/django/blob/master/django/utils/log.py +:source:`django/utils/log.py`. .. setting:: LOGGING_CONFIG diff --git a/docs/ref/templates/api.txt b/docs/ref/templates/api.txt index 5bd55cff65..86ef097749 100644 --- a/docs/ref/templates/api.txt +++ b/docs/ref/templates/api.txt @@ -1026,9 +1026,8 @@ Loader methods .. admonition:: Building your own - For examples, `read the source code for Django's built-in loaders`_. - -.. _read the source code for Django's built-in loaders: https://github.com/django/django/tree/master/django/template/loaders + For examples, read the :source:`source code for Django's built-in loaders + `. .. currentmodule:: django.template.base -- cgit v1.3