Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Converted links to external topics so they use intersphinx extension …

…markup.

This allows to make these links more resilent to changes in the target URLs.
Thanks Jannis for the report and Aymeric Augustin for the patch.

Fixes #16586.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16720 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 932b1b8d6dbd1a4d8e50aa0528c1489094f5704c 1 parent 9110257
Ramiro Morales authored September 04, 2011

Showing 43 changed files with 284 additions and 378 deletions. Show diff stats Hide diff stats

  1. 12  docs/conf.py
  2. 13  docs/faq/install.txt
  3. 17  docs/glossary.txt
  4. 6  docs/howto/custom-template-tags.txt
  5. 6  docs/howto/deployment/modwsgi.txt
  6. 24  docs/howto/outputting-csv.txt
  7. 15  docs/howto/outputting-pdf.txt
  8. 17  docs/internals/contributing/writing-code/branch-policy.txt
  9. 2  docs/internals/contributing/writing-code/coding-style.txt
  10. 22  docs/internals/contributing/writing-documentation.txt
  11. 5  docs/intro/tutorial03.txt
  12. 12  docs/misc/design-philosophies.txt
  13. 20  docs/ref/class-based-views.txt
  14. 12  docs/ref/contrib/csrf.txt
  15. 18  docs/ref/contrib/gis/install.txt
  16. 14  docs/ref/contrib/syndication.txt
  17. 4  docs/ref/django-admin.txt
  18. 14  docs/ref/exceptions.txt
  19. 10  docs/ref/forms/fields.txt
  20. 32  docs/ref/generic-views.txt
  21. 33  docs/ref/models/fields.txt
  22. 4  docs/ref/models/instances.txt
  23. 18  docs/ref/models/querysets.txt
  24. 9  docs/ref/request-response.txt
  25. 8  docs/ref/settings.txt
  26. 11  docs/ref/templates/builtins.txt
  27. 6  docs/ref/unicode.txt
  28. 19  docs/ref/utils.txt
  29. 6  docs/releases/0.96.txt
  30. 6  docs/releases/1.2.txt
  31. 6  docs/releases/1.3-alpha-1.txt
  32. 6  docs/releases/1.3.txt
  33. 2  docs/releases/1.4.txt
  34. 5  docs/topics/db/models.txt
  35. 20  docs/topics/db/sql.txt
  36. 28  docs/topics/email.txt
  37. 20  docs/topics/http/file-uploads.txt
  38. 6  docs/topics/http/sessions.txt
  39. 4  docs/topics/http/shortcuts.txt
  40. 2  docs/topics/http/views.txt
  41. 16  docs/topics/install.txt
  42. 10  docs/topics/logging.txt
  43. 142  docs/topics/testing.txt
12  docs/conf.py
@@ -26,7 +26,7 @@
26 26
 
27 27
 # Add any Sphinx extension module names here, as strings. They can be extensions
28 28
 # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29  
-extensions = ["djangodocs"]
  29
+extensions = ["djangodocs", "sphinx.ext.intersphinx"]
30 30
 
31 31
 # Add any paths that contain templates here, relative to this directory.
32 32
 # templates_path = []
@@ -92,6 +92,16 @@
92 92
 # Note: exclude_dirnames is new in Sphinx 0.5
93 93
 exclude_dirnames = ['.svn']
94 94
 
  95
+# Links to Python's docs should reference the most recent version of the 2.x
  96
+# branch, which is located at this URL.
  97
+intersphinx_mapping = {
  98
+    'python': ('http://docs.python.org/2.7', None),
  99
+    'sphinx': ('http://sphinx.pocoo.org/', None),
  100
+}
  101
+
  102
+# Python's docs don't change every week.
  103
+intersphinx_cache_limit = 90 # days
  104
+
95 105
 # -- Options for HTML output ---------------------------------------------------
96 106
 
97 107
 # The theme to use for HTML and HTML Help pages.  See the documentation for
13  docs/faq/install.txt
@@ -22,10 +22,10 @@ usage.
22 22
 
23 23
 For a development environment -- if you just want to experiment with Django --
24 24
 you don't need to have a separate Web server installed; Django comes with its
25  
-own lightweight development server. For a production environment, Django
26  
-follows the WSGI_ spec, which means it can run on a variety of server
27  
-platforms.  See :doc:`Deploying Django </howto/deployment/index>` for some
28  
-popular alternatives.  Also, the `server arrangements wiki page`_ contains
  25
+own lightweight development server. For a production environment, Django follows
  26
+the WSGI spec, :pep:`3333`, which means it can run on a variety of server
  27
+platforms. See :doc:`Deploying Django </howto/deployment/index>` for some
  28
+popular alternatives. Also, the `server arrangements wiki page`_ contains
29 29
 details for several deployment strategies.
30 30
 
31 31
 If you want to use Django with a database, which is probably the case, you'll
@@ -33,7 +33,6 @@ also need a database engine. PostgreSQL_ is recommended, because we're
33 33
 PostgreSQL fans, and MySQL_, `SQLite 3`_, and Oracle_ are also supported.
34 34
 
35 35
 .. _Python: http://www.python.org/
36  
-.. _WSGI: http://www.python.org/dev/peps/pep-0333/
37 36
 .. _server arrangements wiki page: http://code.djangoproject.com/wiki/ServerArrangements
38 37
 .. _PostgreSQL: http://www.postgresql.org/
39 38
 .. _MySQL: http://www.mysql.com/
@@ -48,7 +47,7 @@ version of Python from 2.5 through 2.7, inclusive. However, newer versions of
48 47
 Python are often faster, have more features, and are better supported. If you
49 48
 use a newer version of Python you will also have access to some APIs that
50 49
 aren't available under older versions of Python. For example, since Python 2.6,
51  
-you can use the advanced string formatting described in `PEP 3101`_.
  50
+you can use the advanced string formatting described in :pep:`3101`.
52 51
 
53 52
 Third-party applications for use with Django are, of course, free to set their
54 53
 own version requirements.
@@ -63,8 +62,6 @@ improvements and optimizations to the Python language since version 2.5, and
63 62
 will help ease the process of dropping support for older Python versions on
64 63
 the road to Python 3.
65 64
 
66  
-.. _PEP 3101: http://www.python.org/dev/peps/pep-3101/
67  
-
68 65
 Can I use Django with Python 2.4?
69 66
 ---------------------------------
70 67
 
17  docs/glossary.txt
@@ -43,19 +43,10 @@ Glossary
43 43
 
44 44
     property
45 45
         Also known as "managed attributes", and a feature of Python since
46  
-        version 2.2. From `the property documentation`__:
47  
-
48  
-            Properties are a neat way to implement attributes whose usage
49  
-            resembles attribute access, but whose implementation uses method
50  
-            calls. [...] You
51  
-            could only do this by overriding ``__getattr__`` and
52  
-            ``__setattr__``; but overriding ``__setattr__`` slows down all
53  
-            attribute assignments considerably, and overriding ``__getattr__``
54  
-            is always a bit tricky to get right. Properties let you do this
55  
-            painlessly, without having to override ``__getattr__`` or
56  
-            ``__setattr__``.
57  
-
58  
-        __ http://www.python.org/download/releases/2.2/descrintro/#property
  46
+        version 2.2. This is a neat way to implement attributes whose usage
  47
+        resembles attribute access, but whose implementation uses method calls.
  48
+
  49
+        See :func:`property`.
59 50
 
60 51
     queryset
61 52
         An object representing some set of rows to be fetched from the database.
6  docs/howto/custom-template-tags.txt
@@ -335,15 +335,13 @@ responsible for returning a ``Node`` instance based on the contents of the tag.
335 335
 
336 336
 For example, let's write a template tag, ``{% current_time %}``, that displays
337 337
 the current date/time, formatted according to a parameter given in the tag, in
338  
-`strftime syntax`_. It's a good idea to decide the tag syntax before anything
339  
-else. In our case, let's say the tag should be used like this:
  338
+:func:`~time.strftime` syntax. It's a good idea to decide the tag syntax before
  339
+anything else. In our case, let's say the tag should be used like this:
340 340
 
341 341
 .. code-block:: html+django
342 342
 
343 343
     <p>The time is {% current_time "%Y-%m-%d %I:%M %p" %}.</p>
344 344
 
345  
-.. _`strftime syntax`: http://docs.python.org/library/time.html#time.strftime
346  
-
347 345
 The parser for this function should grab the parameter and create a ``Node``
348 346
 object::
349 347
 
6  docs/howto/deployment/modwsgi.txt
@@ -9,10 +9,8 @@ Django into production.
9 9
 .. _mod_wsgi: http://code.google.com/p/modwsgi/
10 10
 
11 11
 mod_wsgi is an Apache module which can be used to host any Python application
12  
-which supports the `Python WSGI interface`_, including Django. Django will work
13  
-with any version of Apache which supports mod_wsgi.
14  
-
15  
-.. _python wsgi interface: http://www.python.org/dev/peps/pep-0333/
  12
+which supports the Python WSGI interface described in :pep:`3333`, including
  13
+Django. Django will work with any version of Apache which supports mod_wsgi.
16 14
 
17 15
 The `official mod_wsgi documentation`_ is fantastic; it's your source for all
18 16
 the details about how to use mod_wsgi. You'll probably want to start with the
24  docs/howto/outputting-csv.txt
@@ -3,17 +3,15 @@ Outputting CSV with Django
3 3
 ==========================
4 4
 
5 5
 This document explains how to output CSV (Comma Separated Values) dynamically
6  
-using Django views. To do this, you can either use the `Python CSV library`_ or
7  
-the Django template system.
8  
-
9  
-.. _Python CSV library: http://docs.python.org/library/csv.html
  6
+using Django views. To do this, you can either use the Python CSV library or the
  7
+Django template system.
10 8
 
11 9
 Using the Python CSV library
12 10
 ============================
13 11
 
14  
-Python comes with a CSV library, ``csv``. The key to using it with Django is
15  
-that the ``csv`` module's CSV-creation capability acts on file-like objects, and
16  
-Django's :class:`~django.http.HttpResponse` objects are file-like objects.
  12
+Python comes with a CSV library, :mod:`csv`. The key to using it with Django is
  13
+that the :mod:`csv` module's CSV-creation capability acts on file-like objects,
  14
+and Django's :class:`~django.http.HttpResponse` objects are file-like objects.
17 15
 
18 16
 Here's an example::
19 17
 
@@ -34,7 +32,7 @@ Here's an example::
34 32
 The code and comments should be self-explanatory, but a few things deserve a
35 33
 mention:
36 34
 
37  
-    * The response gets a special MIME type, ``text/csv``. This tells
  35
+    * The response gets a special MIME type, :mimetype:`text/csv`. This tells
38 36
       browsers that the document is a CSV file, rather than an HTML file. If
39 37
       you leave this off, browsers will probably interpret the output as HTML,
40 38
       which will result in ugly, scary gobbledygook in the browser window.
@@ -59,7 +57,7 @@ mention:
59 57
 Handling Unicode
60 58
 ~~~~~~~~~~~~~~~~
61 59
 
62  
-Python's ``csv`` module does not support Unicode input. Since Django uses
  60
+Python's :mod:`csv` module does not support Unicode input. Since Django uses
63 61
 Unicode internally this means strings read from sources such as
64 62
 :class:`~django.http.HttpRequest` are potentially problematic. There are a few
65 63
 options for handling this:
@@ -70,20 +68,18 @@ options for handling this:
70 68
       section`_.
71 69
 
72 70
     * Use the `python-unicodecsv module`_, which aims to be a drop-in
73  
-      replacement for ``csv`` that gracefully handles Unicode.
  71
+      replacement for :mod:`csv` that gracefully handles Unicode.
74 72
 
75  
-For more information, see the Python `CSV File Reading and Writing`_
76  
-documentation.
  73
+For more information, see the Python documentation of the :mod:`csv` module.
77 74
 
78 75
 .. _`csv module's examples section`: http://docs.python.org/library/csv.html#examples
79 76
 .. _`python-unicodecsv module`: https://github.com/jdunck/python-unicodecsv
80  
-.. _`CSV File Reading and Writing`: http://docs.python.org/library/csv.html
81 77
 
82 78
 Using the template system
83 79
 =========================
84 80
 
85 81
 Alternatively, you can use the :doc:`Django template system </topics/templates>`
86  
-to generate CSV. This is lower-level than using the convenient Python ``csv``
  82
+to generate CSV. This is lower-level than using the convenient Python :mod:`csv`
87 83
 module, but the solution is presented here for completeness.
88 84
 
89 85
 The idea here is to pass a list of items to your template, and have the
15  docs/howto/outputting-pdf.txt
@@ -63,10 +63,11 @@ Here's a "Hello World" example::
63 63
 The code and comments should be self-explanatory, but a few things deserve a
64 64
 mention:
65 65
 
66  
-    * The response gets a special MIME type, ``application/pdf``. This tells
67  
-      browsers that the document is a PDF file, rather than an HTML file. If
68  
-      you leave this off, browsers will probably interpret the output as HTML,
69  
-      which would result in ugly, scary gobbledygook in the browser window.
  66
+    * The response gets a special MIME type, :mimetype:`application/pdf`. This
  67
+      tells browsers that the document is a PDF file, rather than an HTML file.
  68
+      If you leave this off, browsers will probably interpret the output as
  69
+      HTML, which would result in ugly, scary gobbledygook in the browser
  70
+      window.
70 71
 
71 72
     * The response gets an additional ``Content-Disposition`` header, which
72 73
       contains the name of the PDF file. This filename is arbitrary: Call it
@@ -97,9 +98,9 @@ Complex PDFs
97 98
 ============
98 99
 
99 100
 If you're creating a complex PDF document with ReportLab, consider using the
100  
-cStringIO_ library as a temporary holding place for your PDF file. The cStringIO
  101
+:mod:`cStringIO` library as a temporary holding place for your PDF file. This
101 102
 library provides a file-like object interface that is particularly efficient.
102  
-Here's the above "Hello World" example rewritten to use ``cStringIO``::
  103
+Here's the above "Hello World" example rewritten to use :mod:`cStringIO`::
103 104
 
104 105
     # Fall back to StringIO in environments where cStringIO is not available
105 106
     try:
@@ -133,8 +134,6 @@ Here's the above "Hello World" example rewritten to use ``cStringIO``::
133 134
         response.write(pdf)
134 135
         return response
135 136
 
136  
-.. _cStringIO: http://docs.python.org/library/stringio.html#module-cStringIO
137  
-
138 137
 Further resources
139 138
 =================
140 139
 
17  docs/internals/contributing/writing-code/branch-policy.txt
@@ -146,14 +146,14 @@ Alternatively, you can use a symlink called ``django`` that points to the
146 146
 location of the branch's ``django`` package. If you want to switch back, just
147 147
 change the symlink to point to the old code.
148 148
 
149  
-A third option is to use a `path file`_ (``<something>.pth``). First, make sure
150  
-there are no files, directories or symlinks named ``django`` in your
151  
-``site-packages`` directory. Then create a text file named ``django.pth`` and
152  
-save it to your ``site-packages`` directory. That file should contain a path to
153  
-your copy of Django on a single line and optional comments. Here is an example
154  
-that points to multiple branches. Just uncomment the line for the branch you
155  
-want to use ('Trunk' in this example) and make sure all other lines are
156  
-commented::
  149
+A third option is to use a path file (``<something>.pth``). This is a feature of
  150
+the :mod:`site` module. First, make sure there are no files, directories or
  151
+symlinks named ``django`` in your ``site-packages`` directory. Then create a
  152
+text file named ``django.pth`` and save it to your ``site-packages`` directory.
  153
+That file should contain a path to your copy of Django on a single line and
  154
+optional comments. Here is an example that points to multiple branches. Just
  155
+uncomment the line for the branch you want to use ('trunk' in this example) and
  156
+make sure all other lines are commented::
157 157
 
158 158
     # Trunk is a svn checkout of:
159 159
     #   http://code.djangoproject.com/svn/django/trunk/
@@ -168,5 +168,4 @@ commented::
168 168
     # On windows a path may look like this:
169 169
     # C:/path/to/<branch>
170 170
 
171  
-.. _path file: http://docs.python.org/library/site.html
172 171
 .. _django-developers: http://groups.google.com/group/django-developers
2  docs/internals/contributing/writing-code/coding-style.txt
@@ -10,7 +10,7 @@ Python style
10 10
     * Unless otherwise specified, follow :pep:`8`.
11 11
 
12 12
       You could use a tool like `pep8`_ to check for some problems in this
13  
-      area, but remember that PEP 8 is only a guide, so respect the style of
  13
+      area, but remember that :pep:`8` is only a guide, so respect the style of
14 14
       the surrounding code as a primary goal.
15 15
 
16 16
     * Use four spaces for indentation.
22  docs/internals/contributing/writing-documentation.txt
@@ -43,12 +43,10 @@ __ http://pygments.org
43 43
 Then, building the HTML is easy; just ``make html`` (or ``make.bat html`` on
44 44
 Windows) from the ``docs`` directory.
45 45
 
46  
-To get started contributing, you'll want to read the `reStructuredText
47  
-Primer`__. After that, you'll want to read about the `Sphinx-specific markup`__
48  
-that's used to manage metadata, indexing, and cross-references.
49  
-
50  
-__ http://sphinx.pocoo.org/rest.html
51  
-__ http://sphinx.pocoo.org/markup/
  46
+To get started contributing, you'll want to read the :ref:`reStructuredText
  47
+Primer <sphinx:rst-primer>`. After that, you'll want to read about the
  48
+:ref:`Sphinx-specific markup <sphinx:sphinxmarkup>` that's used to manage
  49
+metadata, indexing, and cross-references.
52 50
 
53 51
 Commonly used terms
54 52
 -------------------
@@ -113,6 +111,9 @@ documentation:
113 111
       greatly helps readers. There's basically no limit to the amount of
114 112
       useful markup you can add.
115 113
 
  114
+    * Use :mod:`~sphinx.ext.intersphinx` to reference Python's and Sphinx'
  115
+      documentation.
  116
+
116 117
 Django-specific markup
117 118
 ----------------------
118 119
 
@@ -220,12 +221,9 @@ example:
220 221
         You can find both in the :doc:`settings reference document
221 222
         </ref/settings>`.
222 223
 
223  
-      We use the Sphinx doc_ cross reference element when we want to link to
224  
-      another document as a whole and the ref_ element when we want to link to
225  
-      an arbitrary location in a document.
226  
-
227  
-.. _doc: http://sphinx.pocoo.org/markup/inline.html#role-doc
228  
-.. _ref: http://sphinx.pocoo.org/markup/inline.html#role-ref
  224
+      We use the Sphinx :rst:role:`doc` cross reference element when we want to
  225
+      link to another document as a whole and the :rst:role:`ref` element when
  226
+      we want to link to an arbitrary location in a document.
229 227
 
230 228
     * Next, notice how the settings are annotated:
231 229
 
5  docs/intro/tutorial03.txt
@@ -122,14 +122,13 @@ the URLconf will look for ``myapp/``. In a request to
122 122
 ``http://www.example.com/myapp/?page=3``, the URLconf will look for ``myapp/``.
123 123
 
124 124
 If you need help with regular expressions, see `Wikipedia's entry`_ and the
125  
-`Python documentation`_. Also, the O'Reilly book "Mastering Regular Expressions"
126  
-by Jeffrey Friedl is fantastic.
  125
+documentation of the :mod:`re` module. Also, the O'Reilly book "Mastering
  126
+Regular Expressions" by Jeffrey Friedl is fantastic.
127 127
 
128 128
 Finally, a performance note: these regular expressions are compiled the first
129 129
 time the URLconf module is loaded. They're super fast.
130 130
 
131 131
 .. _Wikipedia's entry: http://en.wikipedia.org/wiki/Regular_expression
132  
-.. _Python documentation: http://docs.python.org/library/re.html
133 132
 
134 133
 Write your first view
135 134
 =====================
12  docs/misc/design-philosophies.txt
@@ -73,13 +73,11 @@ as possible.
73 73
 Explicit is better than implicit
74 74
 --------------------------------
75 75
 
76  
-This, a `core Python principle`_, means Django shouldn't do too much "magic."
77  
-Magic shouldn't happen unless there's a really good reason for it. Magic is
78  
-worth using only if it creates a huge convenience unattainable in other ways,
79  
-and it isn't implemented in a way that confuses developers who are trying to
80  
-learn how to use the feature.
81  
-
82  
-.. _`core Python principle`: http://www.python.org/dev/peps/pep-0020/
  76
+This is a core Python principle listed in :pep:`20`, and it means Django
  77
+shouldn't do too much "magic." Magic shouldn't happen unless there's a really
  78
+good reason for it. Magic is worth using only if it creates a huge convenience
  79
+unattainable in other ways, and it isn't implemented in a way that confuses
  80
+developers who are trying to learn how to use the feature.
83 81
 
84 82
 .. _consistency:
85 83
 
20  docs/ref/class-based-views.txt
@@ -586,10 +586,8 @@ YearMixin
586 586
 
587 587
     .. attribute:: year_format
588 588
 
589  
-        The strftime_ format to use when parsing the year. By default, this is
590  
-        ``'%Y'``.
591  
-
592  
-    .. _strftime: http://docs.python.org/library/time.html#time.strftime
  589
+        The :func:`~time.strftime` format to use when parsing the year.
  590
+        By default, this is ``'%Y'``.
593 591
 
594 592
     .. attribute:: year
595 593
 
@@ -598,7 +596,7 @@ YearMixin
598 596
 
599 597
     .. method:: get_year_format()
600 598
 
601  
-        Returns the strftime_ format to use when parsing the year. Returns
  599
+        Returns the :func:`~time.strftime` format to use when parsing the year. Returns
602 600
         :attr:`YearMixin.year_format` by default.
603 601
 
604 602
     .. method:: get_year()
@@ -621,7 +619,7 @@ MonthMixin
621 619
 
622 620
     .. attribute:: month_format
623 621
 
624  
-        The strftime_ format to use when parsing the month. By default, this is
  622
+        The :func:`~time.strftime` format to use when parsing the month. By default, this is
625 623
         ``'%b'``.
626 624
 
627 625
     .. attribute:: month
@@ -631,7 +629,7 @@ MonthMixin
631 629
 
632 630
     .. method:: get_month_format()
633 631
 
634  
-        Returns the strftime_ format to use when parsing the month. Returns
  632
+        Returns the :func:`~time.strftime` format to use when parsing the month. Returns
635 633
         :attr:`MonthMixin.month_format` by default.
636 634
 
637 635
     .. method:: get_month()
@@ -667,7 +665,7 @@ DayMixin
667 665
 
668 666
     .. attribute:: day_format
669 667
 
670  
-        The strftime_ format to use when parsing the day. By default, this is
  668
+        The :func:`~time.strftime` format to use when parsing the day. By default, this is
671 669
         ``'%d'``.
672 670
 
673 671
     .. attribute:: day
@@ -677,7 +675,7 @@ DayMixin
677 675
 
678 676
     .. method:: get_day_format()
679 677
 
680  
-        Returns the strftime_ format to use when parsing the day. Returns
  678
+        Returns the :func:`~time.strftime` format to use when parsing the day. Returns
681 679
         :attr:`DayMixin.day_format` by default.
682 680
 
683 681
     .. method:: get_day()
@@ -712,7 +710,7 @@ WeekMixin
712 710
 
713 711
     .. attribute:: week_format
714 712
 
715  
-        The strftime_ format to use when parsing the week. By default, this is
  713
+        The :func:`~time.strftime` format to use when parsing the week. By default, this is
716 714
         ``'%U'``.
717 715
 
718 716
     .. attribute:: week
@@ -722,7 +720,7 @@ WeekMixin
722 720
 
723 721
     .. method:: get_week_format()
724 722
 
725  
-        Returns the strftime_ format to use when parsing the week. Returns
  723
+        Returns the :func:`~time.strftime` format to use when parsing the week. Returns
726 724
         :attr:`WeekMixin.week_format` by default.
727 725
 
728 726
     .. method:: get_week()
12  docs/ref/contrib/csrf.txt
@@ -14,12 +14,12 @@ who visits the malicious site in their browser.  A related type of attack,
14 14
 a site with someone else's credentials, is also covered.
15 15
 
16 16
 The first defense against CSRF attacks is to ensure that GET requests (and other
17  
-'safe' methods, as defined by `9.1.1 Safe Methods, HTTP 1.1, RFC 2616`_) are
18  
-side-effect free.  Requests via 'unsafe' methods, such as POST, PUT and DELETE,
19  
-can then be protected by following the steps below.
  17
+'safe' methods, as defined by 9.1.1 Safe Methods, HTTP 1.1,
  18
+:rfc:`2616#section-9.1.1`) are side-effect free. Requests via 'unsafe' methods,
  19
+such as POST, PUT and DELETE, can then be protected by following the steps
  20
+below.
20 21
 
21 22
 .. _Cross Site Request Forgeries: http://www.squarefree.com/securitytips/web-developers.html#CSRF
22  
-.. _9.1.1 Safe Methods, HTTP 1.1, RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html
23 23
 
24 24
 .. _using-csrf:
25 25
 
@@ -228,9 +228,9 @@ This ensures that only forms that have originated from your Web site can be used
228 228
 to POST data back.
229 229
 
230 230
 It deliberately ignores GET requests (and other requests that are defined as
231  
-'safe' by RFC 2616). These requests ought never to have any potentially
  231
+'safe' by :rfc:`2616`). These requests ought never to have any potentially
232 232
 dangerous side effects , and so a CSRF attack with a GET request ought to be
233  
-harmless. RFC 2616 defines POST, PUT and DELETE as 'unsafe', and all other
  233
+harmless. :rfc:`2616` defines POST, PUT and DELETE as 'unsafe', and all other
234 234
 methods are assumed to be unsafe, for maximum protection.
235 235
 
236 236
 Caching
18  docs/ref/contrib/gis/install.txt
@@ -1235,13 +1235,17 @@ may be executed from the SQL Shell as the ``postgres`` user::
1235 1235
     postgres# CREATE DATABASE geodjango OWNER geodjango TEMPLATE template_postgis ENCODING 'utf8';
1236 1236
 
1237 1237
 .. rubric:: Footnotes
1238  
-.. [#] The datum shifting files are needed for converting data to and from certain projections.
1239  
-       For example, the PROJ.4 string for the `Google projection (900913) <http://spatialreference.org/ref/epsg/900913/proj4>`_
1240  
-       requires the ``null`` grid file only included in the extra datum shifting files.
1241  
-       It is easier to install the shifting files now, then to have debug a problem caused by their absence later.
1242  
-.. [#] Specifically, GeoDjango provides support for the `OGR <http://gdal.org/ogr>`_ library, a component of GDAL.
  1238
+.. [#] The datum shifting files are needed for converting data to and from
  1239
+       certain projections.
  1240
+       For example, the PROJ.4 string for the `Google projection (900913)
  1241
+       <http://spatialreference.org/ref/epsg/900913/proj4>`_ requires the
  1242
+       ``null`` grid file only included in the extra datum shifting files.
  1243
+       It is easier to install the shifting files now, then to have debug a
  1244
+       problem caused by their absence later.
  1245
+.. [#] Specifically, GeoDjango provides support for the `OGR
  1246
+       <http://gdal.org/ogr>`_ library, a component of GDAL.
1243 1247
 .. [#] See `GDAL ticket #2382 <http://trac.osgeo.org/gdal/ticket/2382>`_.
1244  
-.. [#] GeoDjango uses the `find_library <http://docs.python.org/library/ctypes.html#finding-shared-libraries>`_
1245  
-       routine from ``ctypes.util`` to locate shared libraries.
  1248
+.. [#] GeoDjango uses the :func:`~ctypes.util.find_library` routine from
  1249
+       :mod:`ctypes.util` to locate shared libraries.
1246 1250
 .. [#] The ``psycopg2`` Windows installers are packaged and maintained by
1247 1251
        `Jason Erickson <http://www.stickpeople.com/projects/python/win-psycopg/>`_.
14  docs/ref/contrib/syndication.txt
@@ -852,8 +852,9 @@ They share this interface:
852 852
 
853 853
     All parameters, if given, should be Unicode objects, except:
854 854
 
855  
-        * ``pubdate`` should be a `Python datetime object`_.
856  
-        * ``enclosure`` should be an instance of ``feedgenerator.Enclosure``.
  855
+        * ``pubdate`` should be a Python  :class:`~datetime.datetime` object.
  856
+        * ``enclosure`` should be an instance of
  857
+          :class:`django.utils.feedgenerator.Enclosure`.
857 858
         * ``categories`` should be a sequence of Unicode objects.
858 859
 
859 860
 :meth:`.SyndicationFeed.write`
@@ -884,7 +885,6 @@ For example, to create an Atom 1.0 feed and print it to standard output::
884 885
     </feed>
885 886
 
886 887
 .. _django/utils/feedgenerator.py: http://code.djangoproject.com/browser/django/trunk/django/utils/feedgenerator.py
887  
-.. _Python datetime object: http://docs.python.org/library/datetime.html#datetime-objects
888 888
 
889 889
 .. currentmodule:: django.contrib.syndication
890 890
 
@@ -913,9 +913,9 @@ attributes. Thus, you can subclass the appropriate feed generator class
913 913
 
914 914
 ``SyndicationFeed.add_root_elements(self, handler)``
915 915
     Callback to add elements inside the root feed element
916  
-    (``feed``/``channel``). ``handler`` is an `XMLGenerator`_ from Python's
917  
-    built-in SAX library; you'll call methods on it to add to the XML
918  
-    document in process.
  916
+    (``feed``/``channel``). ``handler`` is an
  917
+    :class:`~xml.sax.saxutils.XMLGenerator` from Python's built-in SAX library;
  918
+    you'll call methods on it to add to the XML document in process.
919 919
 
920 920
 ``SyndicationFeed.item_attributes(self, item)``
921 921
     Return a ``dict`` of attributes to add to each item (``item``/``entry``)
@@ -945,5 +945,3 @@ For example, you might start implementing an iTunes RSS feed generator like so::
945 945
 
946 946
 Obviously there's a lot more work to be done for a complete custom feed class,
947 947
 but the above example should demonstrate the basic idea.
948  
-
949  
-.. _XMLGenerator: http://docs.python.org/dev/library/xml.sax.utils.html#xml.sax.saxutils.XMLGenerator
4  docs/ref/django-admin.txt
@@ -455,7 +455,7 @@ Example usage::
455 455
 .. django-admin-option:: --ignore
456 456
 
457 457
 Use the ``--ignore`` or ``-i`` option to ignore files or directories matching
458  
-the given `glob-style pattern`_. Use multiple times to ignore more.
  458
+the given :mod:`glob`-style pattern. Use multiple times to ignore more.
459 459
 
460 460
 These patterns are used by default: ``'CVS'``, ``'.*'``, ``'*~'``
461 461
 
@@ -463,8 +463,6 @@ Example usage::
463 463
 
464 464
     django-admin.py makemessages --locale=en_US --ignore=apps/* --ignore=secret/*.html
465 465
 
466  
-.. _`glob-style pattern`: http://docs.python.org/library/glob.html
467  
-
468 466
 .. django-admin-option:: --no-default-ignore
469 467
 
470 468
 Use the ``--no-default-ignore`` option to disable the default values of
14  docs/ref/exceptions.txt
@@ -128,10 +128,8 @@ provided in :mod:`django.db`.
128 128
 .. exception:: IntegrityError
129 129
 
130 130
 The Django wrappers for database exceptions behave exactly the same as
131  
-the underlying database exceptions. See `PEP 249 - Python Database API
132  
-Specification v2.0`_ for further information.
133  
-
134  
-.. _`PEP 249 - Python Database API Specification v2.0`: http://www.python.org/dev/peps/pep-0249/
  131
+the underlying database exceptions. See :pep:`249`, the Python Database API
  132
+Specification v2.0, for further information.
135 133
 
136 134
 .. currentmodule:: django.db.transaction
137 135
 
@@ -147,8 +145,6 @@ Transaction Exceptions
147 145
 Python Exceptions
148 146
 =================
149 147
 
150  
-Django raises built-in Python exceptions when appropriate as well. See
151  
-the Python `documentation`_ for further information on the built-in
152  
-exceptions.
153  
-
154  
-.. _`documentation`: http://docs.python.org/lib/module-exceptions.html
  148
+Django raises built-in Python exceptions when appropriate as well. See the
  149
+Python documentation for further information on the
  150
+built-in :mod:`exceptions`.
10  docs/ref/forms/fields.txt
@@ -639,13 +639,11 @@ A field containing either an IPv4 or an IPv6 address.
639 639
     * Validates that the given value is a valid IP address.
640 640
     * Error message keys: ``required``, ``invalid``
641 641
 
642  
-The IPv6 address normalization follows `RFC4291 section 2.2`_, including using
643  
-the IPv4 format suggested in paragraph 3 of that section, like
  642
+The IPv6 address normalization follows :rfc:`4291#section-2.2` section 2.2,
  643
+including using the IPv4 format suggested in paragraph 3 of that section, like
644 644
 ``::ffff:192.0.2.0``. For example, ``2001:0::0:01`` would be normalized to
645  
-``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All
646  
-characters are converted to lowercase.
647  
-
648  
-.. _RFC4291 section 2.2: http://tools.ietf.org/html/rfc4291#section-2.2
  645
+``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All characters
  646
+are converted to lowercase.
649 647
 
650 648
 Takes two optional arguments:
651 649
 
32  docs/ref/generic-views.txt
@@ -346,11 +346,11 @@ date in the *future* are not displayed unless you set ``allow_future`` to
346 346
 
347 347
 **Optional arguments:**
348 348
 
349  
-    * ``month_format``: A format string that regulates what format the
350  
-      ``month`` parameter uses. This should be in the syntax accepted by
351  
-      Python's ``time.strftime``. (See the `strftime docs`_.) It's set to
352  
-      ``"%b"`` by default, which is a three-letter month abbreviation. To
353  
-      change it to use numbers, use ``"%m"``.
  349
+    * ``month_format``: A format string that regulates what format the ``month``
  350
+      parameter uses. This should be in the syntax accepted by Python's
  351
+      :func:`~time.strftime`. It's set to ``"%b"`` by default, which is a
  352
+      three-letter month abbreviation. To change it to use numbers, use
  353
+      ``"%m"``.
354 354
 
355 355
     * ``template_name``: The full name of a template to use in rendering the
356 356
       page. This lets you override the default template name (see below).
@@ -415,8 +415,6 @@ In addition to ``extra_context``, the template's context will be:
415 415
       is ``'object'`` by default. If ``template_object_name`` is ``'foo'``,
416 416
       this variable's name will be ``foo_list``.
417 417
 
418  
-.. _strftime docs: http://docs.python.org/library/time.html#time.strftime
419  
-
420 418
 ``django.views.generic.date_based.archive_week``
421 419
 ------------------------------------------------
422 420
 
@@ -516,11 +514,11 @@ you set ``allow_future`` to ``True``.
516 514
 
517 515
 **Optional arguments:**
518 516
 
519  
-    * ``month_format``: A format string that regulates what format the
520  
-      ``month`` parameter uses. This should be in the syntax accepted by
521  
-      Python's ``time.strftime``. (See the `strftime docs`_.) It's set to
522  
-      ``"%b"`` by default, which is a three-letter month abbreviation. To
523  
-      change it to use numbers, use ``"%m"``.
  517
+    * ``month_format``: A format string that regulates what format the ``month``
  518
+      parameter uses. This should be in the syntax accepted by Python's
  519
+      :func:`~time.strftime`. It's set to ``"%b"`` by default, which is a
  520
+      three-letter month abbreviation. To change it to use numbers, use
  521
+      ``"%m"``.
524 522
 
525 523
     * ``day_format``: Like ``month_format``, but for the ``day`` parameter.
526 524
       It defaults to ``"%d"`` (day of the month as a decimal number, 01-31).
@@ -624,11 +622,11 @@ future, the view will throw a 404 error by default, unless you set
624 622
 
625 623
 **Optional arguments:**
626 624
 
627  
-    * ``month_format``: A format string that regulates what format the
628  
-      ``month`` parameter uses. This should be in the syntax accepted by
629  
-      Python's ``time.strftime``. (See the `strftime docs`_.) It's set to
630  
-      ``"%b"`` by default, which is a three-letter month abbreviation. To
631  
-      change it to use numbers, use ``"%m"``.
  625
+    * ``month_format``: A format string that regulates what format the ``month``
  626
+      parameter uses. This should be in the syntax accepted by Python's
  627
+      :func:`~time.strftime`. It's set to ``"%b"`` by default, which is a
  628
+      three-letter month abbreviation. To change it to use numbers, use
  629
+      ``"%m"``.
632 630
 
633 631
     * ``day_format``: Like ``month_format``, but for the ``day`` parameter.
634 632
       It defaults to ``"%d"`` (day of the month as a decimal number, 01-31).
33  docs/ref/models/fields.txt
@@ -500,9 +500,9 @@ Has one **required** argument:
500 500
     setting to determine the value of the :attr:`~django.core.files.File.url`
501 501
     attribute.
502 502
 
503  
-    This path may contain `strftime formatting`_, which will be replaced by the
504  
-    date/time of the file upload (so that uploaded files don't fill up the given
505  
-    directory).
  503
+    This path may contain :func:`~time.strftime` formatting, which will be
  504
+    replaced by the date/time of the file upload (so that uploaded files don't
  505
+    fill up the given directory).
506 506
 
507 507
     This may also be a callable, such as a function, which will be called to
508 508
     obtain the upload path, including the filename. This callable must be able
@@ -560,10 +560,10 @@ takes a few steps:
560 560
 
561 561
 For example, say your :setting:`MEDIA_ROOT` is set to ``'/home/media'``, and
562 562
 :attr:`~FileField.upload_to` is set to ``'photos/%Y/%m/%d'``. The ``'%Y/%m/%d'``
563  
-part of :attr:`~FileField.upload_to` is `strftime formatting`_; ``'%Y'`` is the
564  
-four-digit year, ``'%m'`` is the two-digit month and ``'%d'`` is the two-digit
565  
-day. If you upload a file on Jan. 15, 2007, it will be saved in the directory
566  
-``/home/media/photos/2007/01/15``.
  563
+part of :attr:`~FileField.upload_to` is :func:`~time.strftime` formatting;
  564
+``'%Y'`` is the four-digit year, ``'%m'`` is the two-digit month and ``'%d'`` is
  565
+the two-digit day. If you upload a file on Jan. 15, 2007, it will be saved in
  566
+the directory ``/home/media/photos/2007/01/15``.
567 567
 
568 568
 If you wanted to retrieve the uploaded file's on-disk filename, or the file's
569 569
 size, you could use the :attr:`~django.core.files.File.name` and
@@ -595,8 +595,6 @@ By default, :class:`FileField` instances are
595 595
 created as ``varchar(100)`` columns in your database. As with other fields, you
596 596
 can change the maximum length using the :attr:`~CharField.max_length` argument.
597 597
 
598  
-.. _`strftime formatting`: http://docs.python.org/library/time.html#time.strftime
599  
-
600 598
 FileField and FieldFile
601 599
 ~~~~~~~~~~~~~~~~~~~~~~~
602 600
 
@@ -711,11 +709,8 @@ The admin represents this as an ``<input type="text">`` (a single-line input).
711 709
     :class:`DecimalField` class. Although they both represent real numbers, they
712 710
     represent those numbers differently. ``FloatField`` uses Python's ``float``
713 711
     type internally, while ``DecimalField`` uses Python's ``Decimal`` type. For
714  
-    information on the difference between the two, see Python's documentation on
715  
-    `Decimal fixed point and floating point arithmetic`_.
716  
-
717  
-.. _Decimal fixed point and floating point arithmetic: http://docs.python.org/library/decimal.html
718  
-
  712
+    information on the difference between the two, see Python's documentation
  713
+    for the :mod:`decimal` module.
719 714
 
720 715
 ``ImageField``
721 716
 --------------
@@ -777,13 +772,11 @@ An IPv4 or IPv6 address, in string format (e.g. ``192.0.2.30`` or
777 772
 ``2a02:42fe::4``). The admin represents this as an ``<input type="text">``
778 773
 (a single-line input).
779 774
 
780  
-The IPv6 address normalization follows `RFC4291 section 2.2`_, including using
781  
-the IPv4 format suggested in paragraph 3 of that section, like
  775
+The IPv6 address normalization follows :rfc:`4291#section-2.2` section 2.2,
  776
+including using the IPv4 format suggested in paragraph 3 of that section, like
782 777
 ``::ffff:192.0.2.0``. For example, ``2001:0::0:01`` would be normalized to
783  
-``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All
784  
-characters are converted to lowercase.
785  
-
786  
-.. _RFC4291 section 2.2: http://tools.ietf.org/html/rfc4291#section-2.2
  778
+``2001::1``, and ``::ffff:0a0a:0a0a`` to ``::ffff:10.10.10.10``. All characters
  779
+are converted to lowercase.
787 780
 
788 781
 .. attribute:: GenericIPAddressField.protocol
789 782
 
4  docs/ref/models/instances.txt
@@ -454,7 +454,7 @@ in ``get_absolute_url()`` and have all your other code call that one place.
454 454
 
455 455
 .. note::
456 456
     The string you return from ``get_absolute_url()`` **must** contain only
457  
-    ASCII characters (required by the URI specfication, `RFC 2396`_) and be
  457
+    ASCII characters (required by the URI specfication, :rfc:`2396`) and be
458 458
     URL-encoded, if necessary.
459 459
 
460 460
     Code and templates calling ``get_absolute_url()`` should be able to use the
@@ -463,8 +463,6 @@ in ``get_absolute_url()`` and have all your other code call that one place.
463 463
     are using unicode strings containing characters outside the ASCII range at
464 464
     all.
465 465
 
466  
-.. _RFC 2396: http://www.ietf.org/rfc/rfc2396.txt
467  
-
468 466
 The ``permalink`` decorator
469 467
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
470 468
 
18  docs/ref/models/querysets.txt
@@ -81,7 +81,7 @@ You can evaluate a ``QuerySet`` in the following ways:
81 81
 Pickling QuerySets
82 82
 ------------------
83 83
 
84  
-If you pickle_ a ``QuerySet``, this will force all the results to be loaded
  84
+If you :mod:`pickle` a ``QuerySet``, this will force all the results to be loaded
85 85
 into memory prior to pickling. Pickling is usually used as a precursor to
86 86
 caching and when the cached queryset is reloaded, you want the results to
87 87
 already be present and ready for use (reading from the database can take some
@@ -112,8 +112,6 @@ described here.
112 112
 	Django version N+1. Pickles should not be used as part of a long-term
113 113
 	archival strategy.
114 114
 
115  
-.. _pickle: http://docs.python.org/library/pickle.html
116  
-
117 115
 .. _queryset-api:
118 116
 
119 117
 QuerySet API
@@ -1210,20 +1208,18 @@ iterator
1210 1208
 
1211 1209
 .. method:: iterator()
1212 1210
 
1213  
-Evaluates the ``QuerySet`` (by performing the query) and returns an `iterator`_
1214  
-over the results. A ``QuerySet`` typically caches its results internally so
1215  
-that repeated evaluations do not result in additional queries. In contrast,
1216  
-``iterator()`` will read results directly, without doing any caching at the
1217  
-``QuerySet`` level (internally, the default iterator calls ``iterator()`` and
1218  
-caches the return value). For a ``QuerySet`` which returns a large number of
  1211
+Evaluates the ``QuerySet`` (by performing the query) and returns an iterator
  1212
+(see :pep:`234`) over the results. A ``QuerySet`` typically caches its results
  1213
+internally so that repeated evaluations do not result in additional queries. In
  1214
+contrast, ``iterator()`` will read results directly, without doing any caching
  1215
+at the ``QuerySet`` level (internally, the default iterator calls ``iterator()``
  1216
+and caches the return value). For a ``QuerySet`` which returns a large number of
1219 1217
 objects that you only need to access once, this can results in better
1220 1218
 performance and a significant reduction in memory.
1221 1219
 
1222 1220
 Note that using ``iterator()`` on a ``QuerySet`` which has already been
1223 1221
 evaluated will force it to evaluate again, repeating the query.
1224 1222
 
1225  
-.. _iterator: http://www.python.org/dev/peps/pep-0234/
1226  
-
1227 1223
 latest
1228 1224
 ~~~~~~
1229 1225
 
9  docs/ref/request-response.txt
@@ -196,9 +196,7 @@ Methods
196 196
     Returns the originating host of the request using information from the
197 197
     ``HTTP_X_FORWARDED_HOST`` and ``HTTP_HOST`` headers (in that order). If
198 198
     they don't provide a value, the method uses a combination of
199  
-    ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in `PEP 333`_.
200  
-
201  
-    .. _PEP 333: http://www.python.org/dev/peps/pep-0333/
  199
+    ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in :pep:`3333`.
202 200
 
203 201
     Example: ``"127.0.0.1:8000"``
204 202
 
@@ -645,7 +643,7 @@ Methods
645 643
     ``expires``, and the auto-calculation of ``max_age`` in such case
646 644
     was added. The ``httponly`` argument was also added.
647 645
 
648  
-    Sets a cookie. The parameters are the same as in the `cookie Morsel`_
  646
+    Sets a cookie. The parameters are the same as in the :class:`Cookie.Morsel`
649 647
     object in the Python standard library.
650 648
 
651 649
         * ``max_age`` should be a number of seconds, or ``None`` (default) if
@@ -664,13 +662,12 @@ Methods
664 662
           JavaScript from having access to the cookie.
665 663
 
666 664
           HTTPOnly_ is a flag included in a Set-Cookie HTTP response
667  
-          header. It is not part of the RFC2109 standard for cookies,
  665
+          header. It is not part of the :rfc:`2109` standard for cookies,
668 666
           and it isn't honored consistently by all browsers. However,
669 667
           when it is honored, it can be a useful way to mitigate the
670 668
           risk of client side script accessing the protected cookie
671 669
           data.
672 670
 
673  
-    .. _`cookie Morsel`: http://docs.python.org/library/cookie.html#Cookie.Morsel
674 671
     .. _HTTPOnly: http://www.owasp.org/index.php/HTTPOnly
675 672
 
676 673
 .. method:: HttpResponse.set_signed_cookie(key, value='', salt='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False)
8  docs/ref/settings.txt
@@ -1010,8 +1010,8 @@ FILE_UPLOAD_PERMISSIONS
1010 1010
 Default: ``None``
1011 1011
 
1012 1012
 The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
1013  
-more information about what these modes mean, see the `documentation for
1014  
-os.chmod`_
  1013
+more information about what these modes mean, see the documentation for
  1014
+:func:`os.chmod`.
1015 1015
 
1016 1016
 If this isn't given or is ``None``, you'll get operating-system
1017 1017
 dependent behavior. On most platforms, temporary files will have a mode
@@ -1028,8 +1028,6 @@ system's standard umask.
1028 1028
     get totally incorrect behavior.
1029 1029
 
1030 1030
 
1031  
-.. _documentation for os.chmod: http://docs.python.org/library/os.html#os.chmod
1032  
-
1033 1031
 .. setting:: FILE_UPLOAD_TEMP_DIR
1034 1032
 
1035 1033
 FILE_UPLOAD_TEMP_DIR
@@ -1586,7 +1584,7 @@ Whether to use HTTPOnly flag on the session cookie. If this is set to
1586 1584
 session cookie.
1587 1585
 
1588 1586
 HTTPOnly_ is a flag included in a Set-Cookie HTTP response header. It
1589  
-is not part of the RFC2109 standard for cookies, and it isn't honored
  1587
+is not part of the :rfc:`2109` standard for cookies, and it isn't honored
1590 1588
 consistently by all browsers. However, when it is honored, it can be a
1591 1589
 useful way to mitigate the risk of client side script accessing the
1592 1590
 protected cookie data.
11  docs/ref/templates/builtins.txt
@@ -1254,7 +1254,8 @@ Available format strings:
1254 1254
     c                 ISO 8601 format. (Note: unlike others     ``2008-01-02T10:30:00.000123+02:00``,
1255 1255
                       formatters, such as "Z", "O" or "r",      or ``2008-01-02T10:30:00.000123`` if the datetime is naive
1256 1256
                       the "c" formatter will not add timezone
1257  
-                      offset if value is a `naive datetime`_.)
  1257
+                      offset if value is a naive datetime
  1258
+                      (see :class:`datetime.tzinfo`).
1258 1259
     d                 Day of the month, 2 digits with           ``'01'`` to ``'31'``
1259 1260
                       leading zeros.
1260 1261
     D                 Day of the week, textual, 3 letters.      ``'Fri'``
@@ -1288,7 +1289,7 @@ Available format strings:
1288 1289
                       if they're zero and the special-case
1289 1290
                       strings 'midnight' and 'noon' if
1290 1291
                       appropriate. Proprietary extension.
1291  
-    r                 RFC 2822 formatted date.                  ``'Thu, 21 Dec 2000 16:01:07 +0200'``
  1292
+    r                 :rfc:`2822` formatted date.               ``'Thu, 21 Dec 2000 16:01:07 +0200'``
1292 1293
     s                 Seconds, 2 digits with leading zeros.     ``'00'`` to ``'59'``
1293 1294
     S                 English ordinal suffix for day of the     ``'st'``, ``'nd'``, ``'rd'`` or ``'th'``
1294 1295
                       month, 2 characters.
@@ -1346,8 +1347,6 @@ used, without applying any localization.
1346 1347
 .. versionchanged:: 1.2
1347 1348
     Predefined formats can now be influenced by the current locale.
1348 1349
 
1349  
-.. _naive datetime: http://docs.python.org/library/datetime.html#datetime.tzinfo
1350  
-
1351 1350
 .. templatefilter:: default
1352 1351
 
1353 1352
 default
@@ -1815,9 +1814,7 @@ Example::
1815 1814
 pprint
1816 1815
 ^^^^^^
1817 1816
 
1818  
-A wrapper around `pprint.pprint`__ -- for debugging, really.
1819  
-
1820  
-__ http://docs.python.org/library/pprint.html
  1817
+A wrapper around :func:`pprint.pprint` -- for debugging, really.
1821 1818
 
1822 1819
 .. templatefilter:: random
1823 1820
 
6  docs/ref/unicode.txt
@@ -148,13 +148,12 @@ URI and IRI handling
148 148
 Web frameworks have to deal with URLs (which are a type of IRI_). One
149 149
 requirement of URLs is that they are encoded using only ASCII characters.
150 150
 However, in an international environment, you might need to construct a
151  
-URL from an IRI_ -- very loosely speaking, a URI that can contain Unicode
  151
+URL from an IRI_ -- very loosely speaking, a URI_ that can contain Unicode
152 152
 characters. Quoting and converting an IRI to URI can be a little tricky, so
153 153
 Django provides some assistance.
154 154
 
155 155
     * The function ``django.utils.encoding.iri_to_uri()`` implements the
156  
-      conversion from IRI to URI as required by the specification (`RFC
157  
-      3987`_).
  156
+      conversion from IRI to URI as required by the specification (:rfc:`3987`).
158 157
 
159 158
     * The functions ``django.utils.http.urlquote()`` and
160 159
       ``django.utils.http.urlquote_plus()`` are versions of Python's standard
@@ -203,7 +202,6 @@ double-quoting problems.
203 202
 
204 203
 .. _URI: http://www.ietf.org/rfc/rfc2396.txt
205 204
 .. _IRI: http://www.ietf.org/rfc/rfc3987.txt
206  
-.. _RFC 3987: IRI_
207 205
 
208 206
 Models
209 207
 ======
19  docs/ref/utils.txt
@@ -21,9 +21,8 @@ managing the ``Vary`` header of responses. It includes functions to patch the
21 21
 header of response objects directly and decorators that change functions to do
22 22
 that header-patching themselves.
23 23
 
24  
-For information on the ``Vary`` header, see `RFC 2616 section 14.44`_.
25  
-
26  
-.. _RFC 2616 section 14.44: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.44
  24
+For information on the ``Vary`` header, see :rfc:`2616#section-14.44` section
  25
+14.44.
27 26
 
28 27
 Essentially, the ``Vary`` HTTP header defines which headers a cache should take
29 28
 into account when building its cache key. Requests with the same path but
@@ -179,11 +178,9 @@ results. Instead do::
179 178
     Convert an Internationalized Resource Identifier (IRI) portion to a URI
180 179
     portion that is suitable for inclusion in a URL.
181 180
 
182  
-    This is the algorithm from section 3.1 of `RFC 3987`_.  However, since we
183  
-    are assuming input is either UTF-8 or unicode already, we can simplify
184  
-    things a little from the full method.
185  
-
186  
-    .. _RFC 3987: http://www.ietf.org/rfc/rfc3987.txt
  181
+    This is the algorithm from section 3.1 of :rfc:`3987#section-3.1`. However,
  182
+    since we are assuming input is either UTF-8 or unicode already, we can
  183
+    simplify things a little from the full method.
187 184
 
188 185
     Returns an ASCII string containing the encoded result.
189 186
 
@@ -397,10 +394,8 @@ Atom1Feed
397 394
 
398 395
 .. function:: http_date(epoch_seconds=None)
399 396
 
400  
-    Formats the time to match the RFC 1123 date format as specified by HTTP
401  
-    `RFC 2616`_ section 3.3.1.
402  
-
403  
-    .. _RFC 2616: http://www.w3.org/Protocols/rfc2616/rfc2616.txt
  397
+    Formats the time to match the :rfc:`1123` date format as specified by HTTP
  398
+    :rfc:`2616#section-3.3.1` section 3.3.1.
404 399
 
405 400
     Accepts a floating point number expressed in seconds since the epoch in
406 401
     UTC--such as that outputted by ``time.time()``. If set to ``None``,
6  docs/releases/0.96.txt
@@ -216,8 +216,8 @@ The test framework
216 216
 ------------------
217 217
 
218 218
 Django now includes a test framework so you can start transmuting fear into
219  
-boredom (with apologies to Kent Beck). You can write tests based on doctest_
220  
-or unittest_ and test your views with a simple test client.
  219
+boredom (with apologies to Kent Beck). You can write tests based on
  220
+:mod:`doctest` or :mod:`unittest` and test your views with a simple test client.
221 221
 
222 222
 There is also new support for "fixtures" -- initial data, stored in any of the
223 223
 supported `serialization formats`_, that will be loaded into your database at the
@@ -225,8 +225,6 @@ start of your tests. This makes testing with real data much easier.
225 225
 
226 226
 See `the testing documentation`_ for the full details.
227 227
 
228  
-.. _doctest: http://docs.python.org/library/doctest.html
229  
-.. _unittest: http://docs.python.org/library/unittest.html
230 228
 .. _the testing documentation: http://www.djangoproject.com/documentation/0.96/testing/
231 229
 .. _serialization formats: http://www.djangoproject.com/documentation/0.96/serialization/
232 230
 
6  docs/releases/1.2.txt
@@ -764,10 +764,8 @@ over the next few release cycles.
764 764
 
765 765
 Code taking advantage of any of the features below will raise a
766 766
 ``PendingDeprecationWarning`` in Django 1.2. This warning will be
767  
-silent by default, but may be turned on using Python's `warnings
768  
-module`_, or by running Python with a ``-Wd`` or `-Wall` flag.
769  
-
770  
-.. _warnings module: http://docs.python.org/library/warnings.html
  767
+silent by default, but may be turned on using Python's :mod:`warnings`
  768
+module, or by running Python with a ``-Wd`` or `-Wall` flag.
771 769
 
772 770
 In Django 1.3, these warnings will become a ``DeprecationWarning``,
773 771
 which is *not* silent. In Django 1.4 support for these features will
6  docs/releases/1.3-alpha-1.txt
@@ -279,10 +279,8 @@ over the next few release cycles.
279 279
 
280 280
 Code taking advantage of any of the features below will raise a
281 281
 ``PendingDeprecationWarning`` in Django 1.3. This warning will be
282  
-silent by default, but may be turned on using Python's `warnings
283  
-module`_, or by running Python with a ``-Wd`` or `-Wall` flag.
284  
-
285  
-.. _warnings module: http://docs.python.org/library/warnings.html
  282
+silent by default, but may be turned on using Python's :mod:`warnings`
  283
+module, or by running Python with a ``-Wd`` or `-Wall` flag.
286 284
 
287 285
 In Django 1.4, these warnings will become a ``DeprecationWarning``,
288 286
 which is *not* silent. In Django 1.5 support for these features will
6  docs/releases/1.3.txt
@@ -664,10 +664,8 @@ over the next few release cycles.
664 664
 
665 665
 Code taking advantage of any of the features below will raise a
666 666
 ``PendingDeprecationWarning`` in Django 1.3. This warning will be
667  
-silent by default, but may be turned on using Python's `warnings
668  
-module`_, or by running Python with a ``-Wd`` or `-Wall` flag.
669  
-
670  
-.. _warnings module: http://docs.python.org/library/warnings.html
  667
+silent by default, but may be turned on using Python's :mod:`warnings`
  668
+module, or by running Python with a ``-Wd`` or `-Wall` flag.
671 669
 
672 670
 In Django 1.4, these warnings will become a ``DeprecationWarning``,
673 671
 which is *not* silent. In Django 1.5 support for these features will
2  docs/releases/1.4.txt
@@ -495,7 +495,7 @@ CSRF protection extended to PUT and DELETE
495 495
 Previously, Django's :doc:`CSRF protection </ref/contrib/csrf/>` provided
496 496
 protection against only POST requests. Since use of PUT and DELETE methods in
497 497
 AJAX applications is becoming more common, we now protect all methods not
498  
-defined as safe by RFC 2616 i.e. we exempt GET, HEAD, OPTIONS and TRACE, and
  498
+defined as safe by :rfc:`2616` i.e. we exempt GET, HEAD, OPTIONS and TRACE, and
499 499
 enforce protection on everything else.
500 500
 
501 501
 If you using PUT or DELETE methods in AJAX applications, please see the
5  docs/topics/db/models.txt
@@ -676,10 +676,7 @@ For example, this model has a few custom methods::