Ticket #16586: 16586.2.patch

File 16586.2.patch, 51.8 KB (added by Aymeric Augustin, 13 years ago)
  • docs/glossary.txt

     
    4343
    4444    property
    4545        Also known as "managed attributes", and a feature of Python since
    46         version 2.2. From `the property documentation`__:
     46        version 2.2. This is a neat way to implement attributes whose usage
     47        resembles attribute access, but whose implementation uses method calls.
    4748
    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__``.
     49        See :func:`property`.
    5750
    58         __ http://www.python.org/download/releases/2.2/descrintro/#property
    59 
    6051    queryset
    6152        An object representing some set of rows to be fetched from the database.
    6253
  • docs/intro/tutorial03.txt

     
    122122``http://www.example.com/myapp/?page=3``, the URLconf will look for ``myapp/``.
    123123
    124124If 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:mod:`Python documentation<re>`. Also, the O'Reilly book "Mastering Regular
     126Expressions" by Jeffrey Friedl is fantastic.
    127127
    128128Finally, a performance note: these regular expressions are compiled the first
    129129time the URLconf module is loaded. They're super fast.
    130130
    131131.. _Wikipedia's entry: http://en.wikipedia.org/wiki/Regular_expression
    132 .. _Python documentation: http://docs.python.org/library/re.html
    133132
    134133Write your first view
    135134=====================
  • docs/misc/design-philosophies.txt

     
    7373Explicit is better than implicit
    7474--------------------------------
    7575
    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.
     76This is a core Python principle listed in :pep:`20`, and it means Django
     77shouldn't do too much "magic." Magic shouldn't happen unless there's a really
     78good reason for it. Magic is worth using only if it creates a huge convenience
     79unattainable in other ways, and it isn't implemented in a way that confuses
     80developers who are trying to learn how to use the feature.
    8181
    82 .. _`core Python principle`: http://www.python.org/dev/peps/pep-0020/
    83 
    8482.. _consistency:
    8583
    8684Consistency
  • docs/internals/contributing/writing-documentation.txt

     
    4343Then, building the HTML is easy; just ``make html`` (or ``make.bat html`` on
    4444Windows) from the ``docs`` directory.
    4545
    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.
     46To get started contributing, you'll want to read the `reStructuredText Primer
     47<rst-primer>`. After that, you'll want to read about the `Sphinx-specific markup
     48<sphinxmarkup>` that's used to manage metadata, indexing, and cross-references.
    4949
    50 __ http://sphinx.pocoo.org/rest.html
    51 __ http://sphinx.pocoo.org/markup/
    52 
    5350Commonly used terms
    5451-------------------
    5552
     
    113110      greatly helps readers. There's basically no limit to the amount of
    114111      useful markup you can add.
    115112
     113    * Use :mod:`intersphinx links <sphinx.ext.intersphinx>` to reference
     114      Python's documentation.
     115
    116116Django-specific markup
    117117----------------------
    118118
     
    220220        You can find both in the :doc:`settings reference document
    221221        </ref/settings>`.
    222222
    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.
     223      We use the Sphinx :rst:role:`doc` cross reference element when we want to
     224      link to another document as a whole and the :rst:role:`ref` element when
     225      we want to link to an arbitrary location in a document.
    226226
    227 .. _doc: http://sphinx.pocoo.org/markup/inline.html#role-doc
    228 .. _ref: http://sphinx.pocoo.org/markup/inline.html#role-ref
    229 
    230227    * Next, notice how the settings are annotated:
    231228
    232229      .. code-block:: rst
  • docs/internals/contributing/writing-code/coding-style.txt

     
    1010    * Unless otherwise specified, follow :pep:`8`.
    1111
    1212      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
    1414      the surrounding code as a primary goal.
    1515
    1616    * Use four spaces for indentation.
  • docs/internals/contributing/writing-code/branch-policy.txt

     
    146146location of the branch's ``django`` package. If you want to switch back, just
    147147change the symlink to point to the old code.
    148148
    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
     149A third option is to use a :mod:`path file<site>` (``<something>.pth``). First,
     150make sure there are no files, directories or symlinks named ``django`` in your
    151151``site-packages`` directory. Then create a text file named ``django.pth`` and
    152152save it to your ``site-packages`` directory. That file should contain a path to
    153153your copy of Django on a single line and optional comments. Here is an example
     
    168168    # On windows a path may look like this:
    169169    # C:/path/to/<branch>
    170170
    171 .. _path file: http://docs.python.org/library/site.html
    172171.. _django-developers: http://groups.google.com/group/django-developers
  • docs/howto/deployment/modwsgi.txt

     
    99.. _mod_wsgi: http://code.google.com/p/modwsgi/
    1010
    1111mod_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.
     12which supports the Python WSGI interface described in :pep:`3333`, including
     13Django. Django will work with any version of Apache which supports mod_wsgi.
    1414
    15 .. _python wsgi interface: http://www.python.org/dev/peps/pep-0333/
    16 
    1715The `official mod_wsgi documentation`_ is fantastic; it's your source for all
    1816the details about how to use mod_wsgi. You'll probably want to start with the
    1917`installation and configuration documentation`_.
  • docs/howto/outputting-csv.txt

     
    33==========================
    44
    55This 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.
     6using Django views. To do this, you can either use the Python CSV library or the
     7Django template system.
    88
    9 .. _Python CSV library: http://docs.python.org/library/csv.html
    10 
    119Using the Python CSV library
    1210============================
    1311
    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.
     12Python comes with a CSV library, :mod:`csv`. The key to using it with Django is
     13that the :mod:`csv` module's CSV-creation capability acts on file-like objects,
     14and Django's :class:`~django.http.HttpResponse` objects are file-like objects.
    1715
    1816Here's an example::
    1917
     
    7270    * Use the `python-unicodecsv module`_, which aims to be a drop-in
    7371      replacement for ``csv`` that gracefully handles Unicode.
    7472
    75 For more information, see the Python `CSV File Reading and Writing`_
     73For more information, see the Python :mod:`CSV File Reading and Writing<csv>`
    7674documentation.
    7775
    7876.. _`csv module's examples section`: http://docs.python.org/library/csv.html#examples
    7977.. _`python-unicodecsv module`: https://github.com/jdunck/python-unicodecsv
    80 .. _`CSV File Reading and Writing`: http://docs.python.org/library/csv.html
    8178
    8279Using the template system
    8380=========================
  • docs/howto/custom-template-tags.txt

     
    335335
    336336For example, let's write a template tag, ``{% current_time %}``, that displays
    337337the 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:`strftime syntax<time.strftime>`. It's a good idea to decide the tag
     339syntax before anything else. In our case, let's say the tag should be used like
     340this:
    340341
    341342.. code-block:: html+django
    342343
    343344    <p>The time is {% current_time "%Y-%m-%d %I:%M %p" %}.</p>
    344345
    345 .. _`strftime syntax`: http://docs.python.org/library/time.html#time.strftime
    346 
    347346The parser for this function should grab the parameter and create a ``Node``
    348347object::
    349348
  • docs/howto/outputting-pdf.txt

     
    9797============
    9898
    9999If 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 library provides a file-like object interface that is particularly efficient.
    102 Here's the above "Hello World" example rewritten to use ``cStringIO``::
     100:mod:`cStringIO` library as a temporary holding place for your PDF file. The
     101``cStringIO`` library provides a file-like object interface that is particularly
     102efficient. Here's the above "Hello World" example rewritten to use
     103``cStringIO``::
    103104
    104105    # Fall back to StringIO in environments where cStringIO is not available
    105106    try:
     
    133134        response.write(pdf)
    134135        return response
    135136
    136 .. _cStringIO: http://docs.python.org/library/stringio.html#module-cStringIO
    137 
    138137Further resources
    139138=================
    140139
  • docs/topics/http/file-uploads.txt

     
    149149
    150150    :setting:`FILE_UPLOAD_PERMISSIONS`
    151151        The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
    152         more information about what these modes mean, see the `documentation for
    153         os.chmod`_
     152        more information about what these modes mean, see the documentation for
     153        :func:`os.chmod`.
    154154
    155155        If this isn't given or is ``None``, you'll get operating-system
    156156        dependent behavior. On most platforms, temporary files will have a mode
     
    179179        Which means "try to upload to memory first, then fall back to temporary
    180180        files."
    181181
    182 .. _documentation for os.chmod: http://docs.python.org/library/os.html#os.chmod
    183 
    184182``UploadedFile`` objects
    185183========================
    186184
  • docs/topics/http/sessions.txt

     
    553553=================
    554554
    555555    * The session dictionary should accept any pickleable Python object. See
    556       `the pickle module`_ for more information.
     556      :mod:`the pickle module <pickle>` for more information.
    557557
    558558    * Session data is stored in a database table named ``django_session`` .
    559559
    560560    * Django only sends a cookie if it needs to. If you don't set any session
    561561      data, it won't send a session cookie.
    562562
    563 .. _`the pickle module`: http://docs.python.org/library/pickle.html
    564 
    565563Session IDs in URLs
    566564===================
    567565
  • docs/topics/install.txt

     
    5252for information on how to configure mod_wsgi once you have it
    5353installed.
    5454
    55 If you can't use mod_wsgi for some reason, fear not: Django supports
    56 many other deployment options. One is :doc:`uWSGI </howto/deployment/fastcgi>`;
    57 it works very well with `nginx`_. Another is :doc:`FastCGI
    58 </howto/deployment/fastcgi>`, perfect for using Django with servers
    59 other than Apache. Additionally, Django follows the WSGI_ spec, which
    60 allows it to run on a variety of server platforms. See the
    61 `server-arrangements wiki page`_ for specific installation
    62 instructions for each platform.
     55If you can't use mod_wsgi for some reason, fear not: Django supports many other
     56deployment options. One is :doc:`uWSGI </howto/deployment/fastcgi>`; it works
     57very well with `nginx`_. Another is :doc:`FastCGI </howto/deployment/fastcgi>`,
     58perfect for using Django with servers other than Apache. Additionally, Django
     59follows the WSGI spec (:pep:`3333`), which allows it to run on a variety of
     60server platforms. See the `server-arrangements wiki page`_ for specific
     61installation instructions for each platform.
    6362
    6463.. _Apache: http://httpd.apache.org/
    6564.. _nginx: http://nginx.net/
    6665.. _mod_wsgi: http://code.google.com/p/modwsgi/
    67 .. _WSGI: http://www.python.org/dev/peps/pep-0333/
    6866.. _server-arrangements wiki page: http://code.djangoproject.com/wiki/ServerArrangements
    6967
    7068.. _database-installation:
  • docs/topics/db/models.txt

     
    676676            return '%s %s' % (self.first_name, self.last_name)
    677677        full_name = property(_get_full_name)
    678678
    679 The last method in this example is a :term:`property`. `Read more about
    680 properties`_.
     679The last method in this example is a :term:`property`.
    681680
    682 .. _Read more about properties: http://www.python.org/download/releases/2.2/descrintro/#property
    683 
    684681The :doc:`model instance reference </ref/models/instances>` has a complete list
    685682of :ref:`methods automatically given to each model <model-instance-methods>`.
    686683You can override most of these -- see `overriding predefined model methods`_,
  • docs/topics/db/sql.txt

     
    259259Connections and cursors
    260260-----------------------
    261261
    262 ``connection`` and ``cursor`` mostly implement the standard `Python DB-API`_
    263 (except when it comes to :doc:`transaction handling </topics/db/transactions>`).
    264 If you're not familiar with the Python DB-API, note that the SQL statement in
    265 ``cursor.execute()`` uses placeholders, ``"%s"``, rather than adding parameters
    266 directly within the SQL. If you use this technique, the underlying database
    267 library will automatically add quotes and escaping to your parameter(s) as
    268 necessary. (Also note that Django expects the ``"%s"`` placeholder, *not* the
    269 ``"?"`` placeholder, which is used by the SQLite Python bindings. This is for
    270 the sake of consistency and sanity.)
    271 
    272 .. _Python DB-API: http://www.python.org/dev/peps/pep-0249/
     262``connection`` and ``cursor`` mostly implement the standard Python DB-API
     263described in :pep:`249` (except when it comes to :doc:`transaction handling
     264</topics/db/transactions>`). If you're not familiar with the Python DB-API, note
     265that the SQL statement in ``cursor.execute()`` uses placeholders, ``"%s"``,
     266rather than adding parameters directly within the SQL. If you use this
     267technique, the underlying database library will automatically add quotes and
     268escaping to your parameter(s) as necessary. (Also note that Django expects the
     269``"%s"`` placeholder, *not* the ``"?"`` placeholder, which is used by the SQLite
     270Python bindings. This is for the sake of consistency and sanity.)
  • docs/topics/testing.txt

     
    6868Writing unit tests
    6969------------------
    7070
    71 Django's unit tests use a Python standard library module: unittest_. This
     71Django's unit tests use a Python standard library module: :mod:`unittest`. This
    7272module defines tests in class-based approach.
    7373
    7474.. admonition:: unittest2
     
    136136Python documentation for more details on how to construct a complex test
    137137suite.
    138138
    139 For more details about ``unittest``, see the `standard library unittest
    140 documentation`_.
     139For more details about ``unittest``, see the :mod:`standard library unittest
     140documentation <unittest>`.
    141141
    142 .. _unittest: http://docs.python.org/library/unittest.html
    143 .. _standard library unittest documentation: unittest_
    144142.. _suggested organization: http://docs.python.org/library/unittest.html#organizing-tests
    145143
    146144Writing doctests
    147145----------------
    148146
    149 Doctests use Python's standard doctest_ module, which searches your docstrings
    150 for statements that resemble a session of the Python interactive interpreter.
    151 A full explanation of how doctest works is out of the scope of this document;
    152 read Python's official documentation for the details.
     147Doctests use :mod:`Python's standard doctest module <doctest>`, which searches
     148your docstrings for statements that resemble a session of the Python interactive
     149interpreter. A full explanation of how doctest works is out of the scope of this
     150document; read Python's official documentation for the details.
    153151
    154152.. admonition:: What's a **docstring**?
    155153
     
    221219on this.) Note that to use this feature, the database user Django is connecting
    222220as must have ``CREATE DATABASE`` rights.
    223221
    224 For more details about how doctest works, see the `standard library
    225 documentation for doctest`_.
     222For more details about how doctest works, see the :mod:`standard library
     223documentation for doctest<doctest>`.
    226224
    227 .. _doctest: http://docs.python.org/library/doctest.html
    228 .. _standard library documentation for doctest: doctest_
    229 
    230 
    231225Which should I use?
    232226-------------------
    233227
     
    639633
    640634      The test client is not capable of retrieving Web pages that are not
    641635      powered by your Django project. If you need to retrieve other Web pages,
    642       use a Python standard library module such as urllib_ or urllib2_.
     636      use a Python standard library module such as :mod:`urllib` or
     637      :mod:`urllib2`.
    643638
    644639    * To resolve URLs, the test client uses whatever URLconf is pointed-to by
    645640      your :setting:`ROOT_URLCONF` setting.
     
    668663          >>> from django.test import Client
    669664          >>> csrf_client = Client(enforce_csrf_checks=True)
    670665
    671 
    672 .. _urllib: http://docs.python.org/library/urllib.html
    673 .. _urllib2: http://docs.python.org/library/urllib2.html
    674 
    675666Making requests
    676667~~~~~~~~~~~~~~~
    677668
     
    1003994.. attribute:: Client.cookies
    1004995
    1005996    A Python ``SimpleCookie`` object, containing the current values of all the
    1006     client cookies. See the `Cookie module documentation`_ for more.
     997    client cookies. See the :mod:`Cookie module documentation<cookie>` for more.
    1007998
    1008999.. attribute:: Client.session
    10091000
     
    10191010            session['somekey'] = 'test'
    10201011            session.save()
    10211012
    1022 .. _Cookie module documentation: http://docs.python.org/library/cookie.html
    1023 
    10241013Example
    10251014~~~~~~~
    10261015
     
    14081397
    14091398.. versionadded:: 1.4
    14101399
    1411 For testing purposes it's often useful to change a setting temporarily
    1412 and revert to the original value after running the testing code. For
    1413 this use case Django provides a standard `Python context manager`_
     1400For testing purposes it's often useful to change a setting temporarily and
     1401revert to the original value after running the testing code. For this use case
     1402Django provides a standard `Python context manager` (see :pep:`343`)
    14141403:meth:`~django.test.TestCase.settings`, which can be used like this::
    14151404
    14161405    from django.test import TestCase
     
    14371426
    14381427In case you want to override a setting for just one test method or even the
    14391428whole TestCase class, Django provides the
    1440 :func:`django.test.utils.override_settings` decorator_. It's used like this::
     1429:func:`django.test.utils.override_settings` decorator (see :pep:`318`). It's
     1430used like this::
    14411431
    14421432    from django.test import TestCase
    14431433    from django.test.utils import override_settings
     
    14831473    :data:`django.test.signals.setting_changed` signal to connect cleanup
    14841474    and other state-resetting callbacks to.
    14851475
    1486 .. _`Python context manager`: http://www.python.org/dev/peps/pep-0343/
    1487 .. _`decorator`: http://www.python.org/dev/peps/pep-0318/
    1488 
    14891476Emptying the test outbox
    14901477~~~~~~~~~~~~~~~~~~~~~~~~
    14911478
  • docs/topics/logging.txt

     
    1111======================
    1212
    1313Django uses Python's builtin logging module to perform system logging.
    14 The usage of the logging module is discussed in detail in `Python's
    15 own documentation`_. However, if you've never used Python's logging
     14The usage of the logging module is discussed in detail in :mod:`Python's
     15own documentation <logging>`. However, if you've never used Python's logging
    1616framework (or even if you have), here's a quick primer.
    1717
    18 .. _Python's own documentation: http://docs.python.org/library/logging.html
    19 
    2018The cast of players
    2119-------------------
    2220
  • docs/topics/email.txt

     
    55.. module:: django.core.mail
    66   :synopsis: Helpers to easily send email.
    77
    8 Although Python makes sending email relatively easy via the `smtplib
    9 library`_, Django provides a couple of light wrappers over it. These wrappers
    10 are provided to make sending email extra quick, to make it easy to test
    11 email sending during development, and to provide support for platforms that
    12 can't use SMTP.
     8Although Python makes sending email relatively easy via the :mod:`smtplib module
     9<smtplib>`, Django provides a couple of light wrappers over it. These wrappers
     10are provided to make sending email extra quick, to make it easy to test email
     11sending during development, and to provide support for platforms that can't use
     12SMTP.
    1313
    1414The code lives in the ``django.core.mail`` module.
    1515
    16 .. _smtplib library: http://docs.python.org/library/smtplib.html
    17 
    1816Quick example
    1917=============
    2018
     
    5452      member of ``recipient_list`` will see the other recipients in the "To:"
    5553      field of the email message.
    5654    * ``fail_silently``: A boolean. If it's ``False``, ``send_mail`` will raise
    57       an ``smtplib.SMTPException``. See the `smtplib docs`_ for a list of
    58       possible exceptions, all of which are subclasses of ``SMTPException``.
     55      an ``smtplib.SMTPException``. See the :mod:`smtplib docs <smtplib>` for a
     56      list of possible exceptions, all of which are subclasses of
     57      ``SMTPException``.
    5958    * ``auth_user``: The optional username to use to authenticate to the SMTP
    6059      server. If this isn't provided, Django will use the value of the
    6160      :setting:`EMAIL_HOST_USER` setting.
     
    6766      See the documentation on :ref:`Email backends <topic-email-backends>`
    6867      for more details.
    6968
    70 .. _smtplib docs: http://docs.python.org/library/smtplib.html
    71 
    7269send_mass_mail()
    7370================
    7471
     
    608605:setting:`EMAIL_PORT` accordingly, and you are set.
    609606
    610607For a more detailed discussion of testing and processing of emails locally,
    611 see the Python documentation on the `SMTP Server`_.
     608see the Python documentation on the :mod:`SMTP Server <smtpd>`.
    612609
    613 .. _SMTP Server: http://docs.python.org/library/smtpd.html
    614 
    615610SMTPConnection
    616611==============
    617612
  • docs/releases/1.3.txt

     
    664664
    665665Code taking advantage of any of the features below will raise a
    666666``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.
     667silent by default, but may be turned on using Python's :mod:`warnings
     668module <warnings>`, or by running Python with a ``-Wd`` or `-Wall` flag.
    669669
    670 .. _warnings module: http://docs.python.org/library/warnings.html
    671 
    672670In Django 1.4, these warnings will become a ``DeprecationWarning``,
    673671which is *not* silent. In Django 1.5 support for these features will
    674672be removed entirely.
  • docs/releases/1.3-alpha-1.txt

     
    279279
    280280Code taking advantage of any of the features below will raise a
    281281``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.
     282silent by default, but may be turned on using Python's :mod:`warnings
     283module <warnings>`, or by running Python with a ``-Wd`` or `-Wall` flag.
    284284
    285 .. _warnings module: http://docs.python.org/library/warnings.html
    286 
    287285In Django 1.4, these warnings will become a ``DeprecationWarning``,
    288286which is *not* silent. In Django 1.5 support for these features will
    289287be removed entirely.
  • docs/releases/0.96.txt

     
    216216------------------
    217217
    218218Django 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.
     219boredom (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.
    221221
    222222There is also new support for "fixtures" -- initial data, stored in any of the
    223223supported `serialization formats`_, that will be loaded into your database at the
     
    225225
    226226See `the testing documentation`_ for the full details.
    227227
    228 .. _doctest: http://docs.python.org/library/doctest.html
    229 .. _unittest: http://docs.python.org/library/unittest.html
    230228.. _the testing documentation: http://www.djangoproject.com/documentation/0.96/testing/
    231229.. _serialization formats: http://www.djangoproject.com/documentation/0.96/serialization/
    232230
  • docs/releases/1.2.txt

     
    764764
    765765Code taking advantage of any of the features below will raise a
    766766``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.
     767silent by default, but may be turned on using Python's :mod:`warnings
     768module <warnings>`, or by running Python with a ``-Wd`` or `-Wall` flag.
    769769
    770 .. _warnings module: http://docs.python.org/library/warnings.html
    771 
    772770In Django 1.3, these warnings will become a ``DeprecationWarning``,
    773771which is *not* silent. In Django 1.4 support for these features will
    774772be removed entirely.
  • docs/faq/install.txt

     
    2222
    2323For a development environment -- if you just want to experiment with Django --
    2424you 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
     25own lightweight development server. For a production environment, Django follows
     26the WSGI spec, :pep:`3333`, which means it can run on a variety of server
     27platforms. See :doc:`Deploying Django </howto/deployment/index>` for some
     28popular alternatives. Also, the `server arrangements wiki page`_ contains
    2929details for several deployment strategies.
    3030
    3131If you want to use Django with a database, which is probably the case, you'll
     
    3333PostgreSQL fans, and MySQL_, `SQLite 3`_, and Oracle_ are also supported.
    3434
    3535.. _Python: http://www.python.org/
    36 .. _WSGI: http://www.python.org/dev/peps/pep-0333/
    3736.. _server arrangements wiki page: http://code.djangoproject.com/wiki/ServerArrangements
    3837.. _PostgreSQL: http://www.postgresql.org/
    3938.. _MySQL: http://www.mysql.com/
     
    4847Python are often faster, have more features, and are better supported. If you
    4948use a newer version of Python you will also have access to some APIs that
    5049aren'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`_.
     50you can use the advanced string formatting described in :pep:`3101`.
    5251
    5352Third-party applications for use with Django are, of course, free to set their
    5453own version requirements.
     
    6362will help ease the process of dropping support for older Python versions on
    6463the road to Python 3.
    6564
    66 .. _PEP 3101: http://www.python.org/dev/peps/pep-3101/
    67 
    6865Can I use Django with Python 2.4?
    6966---------------------------------
    7067
  • docs/ref/models/querysets.txt

     
    8181Pickling QuerySets
    8282------------------
    8383
    84 If you pickle_ a ``QuerySet``, this will force all the results to be loaded
     84If you :mod:`pickle` a ``QuerySet``, this will force all the results to be loaded
    8585into memory prior to pickling. Pickling is usually used as a precursor to
    8686caching and when the cached queryset is reloaded, you want the results to
    8787already be present and ready for use (reading from the database can take some
     
    112112        Django version N+1. Pickles should not be used as part of a long-term
    113113        archival strategy.
    114114
    115 .. _pickle: http://docs.python.org/library/pickle.html
    116 
    117115.. _queryset-api:
    118116
    119117QuerySet API
     
    11901188.. method:: iterator()
    11911189
    11921190Evaluates the ``QuerySet`` (by performing the query) and returns an
    1193 `iterator`_ over the results. A ``QuerySet`` typically caches its
     1191iterator (see :pep:`234`) over the results. A ``QuerySet`` typically caches its
    11941192results internally so that repeated evaluations do not result in
    11951193additional queries; ``iterator()`` will instead read results directly,
    11961194without doing any caching at the ``QuerySet`` level. For a
     
    12001198Note that using ``iterator()`` on a ``QuerySet`` which has already
    12011199been evaluated will force it to evaluate again, repeating the query.
    12021200
    1203 .. _iterator: http://www.python.org/dev/peps/pep-0234/
    1204 
    12051201latest
    12061202~~~~~~
    12071203
  • docs/ref/models/fields.txt

     
    500500    setting to determine the value of the :attr:`~django.core.files.File.url`
    501501    attribute.
    502502
    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:`strftime formatting <time.strftime>`, which
     504    will be replaced by the date/time of the file upload (so that uploaded files
     505    don't fill up the given directory).
    506506
    507507    This may also be a callable, such as a function, which will be called to
    508508    obtain the upload path, including the filename. This callable must be able
     
    560560
    561561For example, say your :setting:`MEDIA_ROOT` is set to ``'/home/media'``, and
    562562: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``.
     563part of :attr:`~FileField.upload_to` is :func:`strftime formatting
     564<time.strftime>`; ``'%Y'`` is the four-digit year, ``'%m'`` is the two-digit
     565month and ``'%d'`` is the two-digit day. If you upload a file on Jan. 15, 2007,
     566it will be saved in the directory ``/home/media/photos/2007/01/15``.
    567567
    568568If you wanted to retrieve the uploaded file's on-disk filename, or the file's
    569569size, you could use the :attr:`~django.core.files.File.name` and
     
    595595created as ``varchar(100)`` columns in your database. As with other fields, you
    596596can change the maximum length using the :attr:`~CharField.max_length` argument.
    597597
    598 .. _`strftime formatting`: http://docs.python.org/library/time.html#time.strftime
    599 
    600598FileField and FieldFile
    601599~~~~~~~~~~~~~~~~~~~~~~~
    602600
     
    712710    represent those numbers differently. ``FloatField`` uses Python's ``float``
    713711    type internally, while ``DecimalField`` uses Python's ``Decimal`` type. For
    714712    information on the difference between the two, see Python's documentation on
    715     `Decimal fixed point and floating point arithmetic`_.
     713    :mod:`Decimal fixed point and floating point arithmetic <decimal>`.
    716714
    717 .. _Decimal fixed point and floating point arithmetic: http://docs.python.org/library/decimal.html
    718 
    719 
    720715``ImageField``
    721716--------------
    722717
  • docs/ref/generic-views.txt

     
    346346
    347347**Optional arguments:**
    348348
    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"``.
    354354
    355355    * ``template_name``: The full name of a template to use in rendering the
    356356      page. This lets you override the default template name (see below).
     
    415415      is ``'object'`` by default. If ``template_object_name`` is ``'foo'``,
    416416      this variable's name will be ``foo_list``.
    417417
    418 .. _strftime docs: http://docs.python.org/library/time.html#time.strftime
    419 
    420418``django.views.generic.date_based.archive_week``
    421419------------------------------------------------
    422420
     
    516514
    517515**Optional arguments:**
    518516
    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"``.
    524522
    525523    * ``day_format``: Like ``month_format``, but for the ``day`` parameter.
    526524      It defaults to ``"%d"`` (day of the month as a decimal number, 01-31).
     
    624622
    625623**Optional arguments:**
    626624
    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"``.
    632630
    633631    * ``day_format``: Like ``month_format``, but for the ``day`` parameter.
    634632      It defaults to ``"%d"`` (day of the month as a decimal number, 01-31).
  • docs/ref/class-based-views.txt

     
    586586
    587587    .. attribute:: year_format
    588588
    589         The strftime_ format to use when parsing the year. By default, this is
    590         ``'%Y'``.
     589        The :func:`strftime<time.strftime>` format to use when parsing the year.
     590        By default, this is ``'%Y'``.
    591591
    592     .. _strftime: http://docs.python.org/library/time.html#time.strftime
    593 
    594592    .. attribute:: year
    595593
    596594        **Optional** The value for the year (as a string). By default, set to
     
    598596
    599597    .. method:: get_year_format()
    600598
    601         Returns the strftime_ format to use when parsing the year. Returns
     599        Returns the :func:`strftime<time.strftime>` format to use when parsing the year. Returns
    602600        :attr:`YearMixin.year_format` by default.
    603601
    604602    .. method:: get_year()
     
    621619
    622620    .. attribute:: month_format
    623621
    624         The strftime_ format to use when parsing the month. By default, this is
     622        The :func:`strftime<time.strftime>` format to use when parsing the month. By default, this is
    625623        ``'%b'``.
    626624
    627625    .. attribute:: month
     
    631629
    632630    .. method:: get_month_format()
    633631
    634         Returns the strftime_ format to use when parsing the month. Returns
     632        Returns the :func:`strftime<time.strftime>` format to use when parsing the month. Returns
    635633        :attr:`MonthMixin.month_format` by default.
    636634
    637635    .. method:: get_month()
     
    667665
    668666    .. attribute:: day_format
    669667
    670         The strftime_ format to use when parsing the day. By default, this is
     668        The :func:`strftime<time.strftime>` format to use when parsing the day. By default, this is
    671669        ``'%d'``.
    672670
    673671    .. attribute:: day
     
    677675
    678676    .. method:: get_day_format()
    679677
    680         Returns the strftime_ format to use when parsing the day. Returns
     678        Returns the :func:`strftime<time.strftime>` format to use when parsing the day. Returns
    681679        :attr:`DayMixin.day_format` by default.
    682680
    683681    .. method:: get_day()
     
    712710
    713711    .. attribute:: week_format
    714712
    715         The strftime_ format to use when parsing the week. By default, this is
     713        The :func:`strftime<time.strftime>` format to use when parsing the week. By default, this is
    716714        ``'%U'``.
    717715
    718716    .. attribute:: week
     
    722720
    723721    .. method:: get_week_format()
    724722
    725         Returns the strftime_ format to use when parsing the week. Returns
     723        Returns the :func:`strftime<time.strftime>` format to use when parsing the week. Returns
    726724        :attr:`WeekMixin.week_format` by default.
    727725
    728726    .. method:: get_week()
  • docs/ref/templates/builtins.txt

     
    12541254    c                 ISO 8601 format. (Note: unlike others     ``2008-01-02T10:30:00.000123+02:00``,
    12551255                      formatters, such as "Z", "O" or "r",      or ``2008-01-02T10:30:00.000123`` if the datetime is naive
    12561256                      the "c" formatter will not add timezone
    1257                       offset if value is a `naive datetime`_.)
     1257                      offset if value is a :class:`naive
     1258                      datetime <datetime.tzinfo>`.)
    12581259    d                 Day of the month, 2 digits with           ``'01'`` to ``'31'``
    12591260                      leading zeros.
    12601261    D                 Day of the week, textual, 3 letters.      ``'Fri'``
     
    13461347.. versionchanged:: 1.2
    13471348    Predefined formats can now be influenced by the current locale.
    13481349
    1349 .. _naive datetime: http://docs.python.org/library/datetime.html#datetime.tzinfo
    1350 
    13511350.. templatefilter:: default
    13521351
    13531352default
     
    18151814pprint
    18161815^^^^^^
    18171816
    1818 A wrapper around `pprint.pprint`__ -- for debugging, really.
     1817A wrapper around :func:`pprint.pprint` -- for debugging, really.
    18191818
    1820 __ http://docs.python.org/library/pprint.html
    1821 
    18221819.. templatefilter:: random
    18231820
    18241821random
  • docs/ref/exceptions.txt

     
    128128.. exception:: IntegrityError
    129129
    130130The 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.
     131the underlying database exceptions. See :pep:`249`, the Python Database API
     132Specification v2.0, for further information.
    133133
    134 .. _`PEP 249 - Python Database API Specification v2.0`: http://www.python.org/dev/peps/pep-0249/
    135 
    136134.. currentmodule:: django.db.transaction
    137135
    138136Transaction Exceptions
     
    147145Python Exceptions
    148146=================
    149147
    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
     148Django raises built-in Python exceptions when appropriate as well. See the
     149:mod:`Python documentation <exceptions>` for further information on the
     150built-in exceptions.
  • docs/ref/contrib/gis/install.txt

     
    12351235    postgres# CREATE DATABASE geodjango OWNER geodjango TEMPLATE template_postgis ENCODING 'utf8';
    12361236
    12371237.. 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.
    12431247.. [#] 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:`find_library <ctypes.util.find_library>`
     1249       routine from :mod:`ctypes.util` to locate shared libraries.
    12461250.. [#] The ``psycopg2`` Windows installers are packaged and maintained by
    12471251       `Jason Erickson <http://www.stickpeople.com/projects/python/win-psycopg/>`_.
  • docs/ref/contrib/syndication.txt

     
    852852
    853853    All parameters, if given, should be Unicode objects, except:
    854854
    855         * ``pubdate`` should be a `Python datetime object`_.
     855        * ``pubdate`` should be a :class:`Python datetime object<datetime.datetime>`.
    856856        * ``enclosure`` should be an instance of ``feedgenerator.Enclosure``.
    857857        * ``categories`` should be a sequence of Unicode objects.
    858858
     
    884884    </feed>
    885885
    886886.. _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
    888887
    889888.. currentmodule:: django.contrib.syndication
    890889
     
    913912
    914913``SyndicationFeed.add_root_elements(self, handler)``
    915914    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.
     915    (``feed``/``channel``). ``handler`` is an :class:`XMLGenerator
     916    <xml.sax.saxutils.XMLGenerator>` from Python's built-in SAX library; you'll
     917    call methods on it to add to the XML document in process.
    919918
    920919``SyndicationFeed.item_attributes(self, item)``
    921920    Return a ``dict`` of attributes to add to each item (``item``/``entry``)
     
    945944
    946945Obviously there's a lot more work to be done for a complete custom feed class,
    947946but 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
  • docs/ref/request-response.txt

     
    196196    Returns the originating host of the request using information from the
    197197    ``HTTP_X_FORWARDED_HOST`` and ``HTTP_HOST`` headers (in that order). If
    198198    they don't provide a value, the method uses a combination of
    199     ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in `PEP 333`_.
     199    ``SERVER_NAME`` and ``SERVER_PORT`` as detailed in :pep:`3333`.
    200200
    201     .. _PEP 333: http://www.python.org/dev/peps/pep-0333/
    202 
    203201    Example: ``"127.0.0.1:8000"``
    204202
    205203    .. note:: The :meth:`~HttpRequest.get_host()` method fails when the host is
     
    645643    ``expires``, and the auto-calculation of ``max_age`` in such case
    646644    was added. The ``httponly`` argument was also added.
    647645
    648     Sets a cookie. The parameters are the same as in the `cookie Morsel`_
    649     object in the Python standard library.
     646    Sets a cookie. The parameters are the same as in the :class:`cookie Morsel
     647    <Cookie.Morsel>` object in the Python standard library.
    650648
    651649        * ``max_age`` should be a number of seconds, or ``None`` (default) if
    652650          the cookie should last only as long as the client's browser session.
     
    670668          risk of client side script accessing the protected cookie
    671669          data.
    672670
    673     .. _`cookie Morsel`: http://docs.python.org/library/cookie.html#Cookie.Morsel
    674671    .. _HTTPOnly: http://www.owasp.org/index.php/HTTPOnly
    675672
    676673.. method:: HttpResponse.set_signed_cookie(key, value='', salt='', max_age=None, expires=None, path='/', domain=None, secure=None, httponly=False)
  • docs/ref/django-admin.txt

     
    455455.. django-admin-option:: --ignore
    456456
    457457Use the ``--ignore`` or ``-i`` option to ignore files or directories matching
    458 the given `glob-style pattern`_. Use multiple times to ignore more.
     458the given :mod:`glob-style pattern <glob>`. Use multiple times to ignore more.
    459459
    460460These patterns are used by default: ``'CVS'``, ``'.*'``, ``'*~'``
    461461
     
    463463
    464464    django-admin.py makemessages --locale=en_US --ignore=apps/* --ignore=secret/*.html
    465465
    466 .. _`glob-style pattern`: http://docs.python.org/library/glob.html
    467 
    468466.. django-admin-option:: --no-default-ignore
    469467
    470468Use the ``--no-default-ignore`` option to disable the default values of
  • docs/ref/settings.txt

     
    950950Default: ``None``
    951951
    952952The numeric mode (i.e. ``0644``) to set newly uploaded files to. For
    953 more information about what these modes mean, see the `documentation for
    954 os.chmod`_
     953more information about what these modes mean, see the documentation for
     954:func:`os.chmod`.
    955955
    956956If this isn't given or is ``None``, you'll get operating-system
    957957dependent behavior. On most platforms, temporary files will have a mode
     
    968968    get totally incorrect behavior.
    969969
    970970
    971 .. _documentation for os.chmod: http://docs.python.org/library/os.html#os.chmod
    972 
    973971.. setting:: FILE_UPLOAD_TEMP_DIR
    974972
    975973FILE_UPLOAD_TEMP_DIR
  • docs/conf.py

     
    2626
    2727# Add any Sphinx extension module names here, as strings. They can be extensions
    2828# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
    29 extensions = ["djangodocs"]
     29extensions = ["djangodocs", "sphinx.ext.intersphinx"]
    3030
    3131# Add any paths that contain templates here, relative to this directory.
    3232# templates_path = []
     
    9292# Note: exclude_dirnames is new in Sphinx 0.5
    9393exclude_dirnames = ['.svn']
    9494
     95# Links to Python's docs should reference the most recent version of the 2.x
     96# branch, which is located at this URL.
     97intersphinx_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.
     103intersphinx_cache_limit = 90 # days
     104
    95105# -- Options for HTML output ---------------------------------------------------
    96106
    97107# The theme to use for HTML and HTML Help pages.  See the documentation for
Back to Top