Ticket #9000: doc-fixes-r8995.diff

File doc-fixes-r8995.diff, 26.2 KB (added by ramiro, 7 years ago)

Patch generated using Mercurial, apply using patch -p1

  • django/conf/project_template/settings.py

    diff -r 6469880f5067 django/conf/project_template/settings.py
    a b MANAGERS = ADMINS 
    1010MANAGERS = ADMINS
    1111
    1212DATABASE_ENGINE = ''           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
    13 DATABASE_NAME = ''             # Or path to database file if using sqlite3.
     13DATABASE_NAME = ''             # Or full absolute path to database file if using sqlite3 (when
     14                               # specifying the path, always use forward slashes, even on Windows).
    1415DATABASE_USER = ''             # Not used with sqlite3.
    1516DATABASE_PASSWORD = ''         # Not used with sqlite3.
    1617DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
  • docs/internals/contributing.txt

    diff -r 6469880f5067 docs/internals/contributing.txt
    a b translated, here's what to do: 
    399399translated, here's what to do:
    400400
    401401    * Join the `Django i18n mailing list`_ and introduce yourself.
    402    
     402
    403403    * Create translations using the methods described in the :ref:`i18n
    404404      documentation <topics-i18n>`. For this you will use the ``django-admin.py
    405405      makemessages`` tool. In this particular case it should be run from the
    406       top-level``django`` directory of the Django source tree.
     406      top-level ``django`` directory of the Django source tree.
    407407
    408408      The script runs over the entire Django source tree and pulls out all
    409409      strings marked for translation. It creates (or updates) a message file in
    410410      the directory ``conf/locale`` (for example for ``pt-BR``, the file will be
    411411      ``conf/locale/pt-br/LC_MESSAGES/django.po``).
    412      
     412
    413413    * Make sure that ``django-admin.py compilemessages -l <lang>`` runs without
    414414      producing any warnings.
    415    
     415
    416416    * Repeat the last two steps for the ``djangojs`` domain (by appending the
    417417      ``-d djangojs`` command line option to the ``django-admin.py``
    418       invocations.
    419    
     418      invocations.)
     419
    420420    * Create a diff of the ``.po`` file(s) against the current Subversion trunk.
    421    
     421
    422422    * Open a ticket in Django's ticket system, set its ``Component`` field to
    423423      ``Translations``, and attach the patch to it.
    424424
  • docs/internals/documentation.txt

    diff -r 6469880f5067 docs/internals/documentation.txt
    a b semantic markup you can add the better.  
    2828semantic markup you can add the better. So::
    2929
    3030    Add ``django.contrib.auth`` to your ``INSTALLED_APPS``...
    31    
     31
    3232Isn't nearly as helpful as::
    3333
    3434    Add :mod:`django.contrib.auth` to your :setting:`INSTALLED_APPS`...
    35    
    36 This is because Sphinx will generate proper links for the later, which greatly
     35
     36This is because Sphinx will generate proper links for the latter, which greatly
    3737helps readers. There's basically no limit to the amount of useful markup you can
    3838add.
    3939
    __ http://sphinx.pocoo.org/markup/desc.h 
    4545__ http://sphinx.pocoo.org/markup/desc.html
    4646
    4747    * Settings::
    48    
     48
    4949            .. setting:: INSTALLED_APPS
    50                
     50
    5151      To link to a setting, use ``:setting:`INSTALLED_APPS```.
    52      
     52
    5353    * Template tags::
    54    
     54
    5555            .. templatetag:: regroup
    56    
     56
    5757      To link, use ``:ttag:`regroup```.
    58      
     58
    5959    * Template filters::
    60    
     60
    6161            .. templatefilter:: linebreaksbr
    62        
     62
    6363      To link, use ``:tfilter:`linebreaksbr```.
    64      
     64
    6565    * Field lookups (i.e. ``Foo.objects.filter(bar__exact=whatever)``)::
    66    
     66
    6767            .. fieldlookup:: exact
    68            
     68
    6969      To link, use ``:lookup:`exact```.
    70      
     70
    7171    * ``django-admin`` commands::
    72    
     72
    7373            .. django-admin:: syncdb
    74            
     74
    7575      To link, use ``:djadmin:`syncdb```.
    76      
     76
    7777    * ``django-admin`` command-line options::
    78    
     78
    7979            .. django-admin-option:: --traceback
    80            
     80
    8181      To link, use ``:djadminopt:`--traceback```.
    8282
    8383An example
    For a quick example of how it all fits t 
    8686For a quick example of how it all fits together, check this out:
    8787
    8888    * First, the ``ref/settings.txt`` document starts out like this::
    89    
     89
    9090        .. _ref-settings:
    9191
    9292        Available settings
    9393        ==================
    94        
     94
    9595        ...
    96        
     96
    9797    * Next, if you look at the ``topics/settings.txt`` document, you can see how
    9898      a link to ``ref/settings`` works::
    99      
     99
    100100        Available settings
    101101        ==================
    102102
    103103        For a full list of available settings, see the :ref:`settings reference
    104104        <ref-settings>`.
    105        
     105
    106106    * Next, notice how the settings (right now just the top few) are annotated::
    107    
     107
    108108        .. setting:: ADMIN_FOR
    109109
    110110        ADMIN_FOR
    For a quick example of how it all fits t 
    115115        Used for admin-site settings modules, this should be a tuple of settings
    116116        modules (in the format ``'foo.bar.baz'``) for which this site is an
    117117        admin.
    118        
     118
    119119        The admin site uses this in its automatically-introspected
    120120        documentation of models, views and template tags.
    121        
     121
    122122      This marks up the following header as the "canonical" target for the
    123123      setting ``ADMIN_FOR`` This means any time I talk about ``ADMIN_FOR``, I
    124124      can reference it using ``:setting:`ADMIN_FOR```.
    125      
     125
    126126That's basically how everything fits together.
    127127
    128128TODO
    The work is mostly done, but here's what 
    134134      this TODO item my permission and license) into
    135135      ``topics/generic-views.txt``; remove the intro material from
    136136      ``ref/generic-views.txt`` and just leave the function reference.
    137    
     137
    138138    * Change the "Added/changed in development version" callouts to proper
    139139      Sphinx ``.. versionadded::`` or ``.. versionchanged::`` directives.
    140    
     140
    141141    * Check for and fix malformed links. Do this by running ``make linkcheck``
    142142      and fix all of the 300+ errors/warnings.
    143      
    144       In particular, look at all the relative links; these need to be 
     143
     144      In particular, look at all the relative links; these need to be
    145145      changed to proper references.
    146      
     146
    147147    * Most of the various ``index.txt`` documents have *very* short or even
    148148      non-existent intro text. Each of those documents needs a good short intro
    149149      the content below that point.
    150150
    151151    * The glossary is very perfunctory. It needs to be filled out.
    152    
     152
    153153    * Add more metadata targets: there's lots of places that look like::
    154    
     154
    155155            ``File.close()``
    156156            ~~~~~~~~~~~~~~~~
    157        
     157
    158158      \... these should be::
    159      
     159
    160160            .. method:: File.close()
    161            
     161
    162162      That is, use metadata instead of titles.
    163      
     163
    164164    * Add more links -- nearly everything that's an inline code literal
    165       right now can probably be turned into a xref. 
    166      
     165      right now can probably be turned into a xref.
     166
    167167      See the ``literals_to_xrefs.py`` file in ``_ext`` -- it's a shell script
    168168      to help do this work.
    169169
    170170      This will probably be a continuing, never-ending project.
    171171
    172172    * Add `info field lists`__ where appropriate.
    173    
     173
    174174      __ http://sphinx.pocoo.org/markup/desc.html#info-field-lists
    175      
     175
    176176    * Add ``.. code-block:: <lang>`` to literal blocks so that they get
    177177      highlighted.
    178178
    Some hints for making things look/read b 
    189189      "crossref" directives. Others (``.. class::``, e.g.) generate their own
    190190      markup; these should go inside the section they're describing. These are
    191191      called "description units".
    192      
     192
    193193      You can tell which are which by looking at in :file:`_ext/djangodocs.py`;
    194194      it registers roles as one of the other.
    195      
     195
    196196    * When referring to classes/functions/modules, etc., you'll want to use the
    197197      fully-qualified name of the target
    198       (``:class:`django.contrib.contenttypes.models.ContentType```). 
    199      
     198      (``:class:`django.contrib.contenttypes.models.ContentType```).
     199
    200200      Since this doesn't look all that awesome in the output -- it shows the
    201201      entire path to the object -- you can prefix the target with a ``~``
    202202      (that's a tilde) to get just the "last bit" of that path. So
  • docs/intro/tutorial01.txt

    diff -r 6469880f5067 docs/intro/tutorial01.txt
    a b create a ``mysite`` directory in your cu 
    4242create a ``mysite`` directory in your current directory.
    4343
    4444.. admonition:: Mac OS X permissions
    45    
     45
    4646   If you're using Mac OS X, you may see the message "permission denied" when
    4747   you try to run ``django-admin.py startproject``. This is because, on
    4848   Unix-based systems like OS X, a file must be marked as "executable" before it
    4949   can be run as a program. To do this, open Terminal.app and navigate (using
    5050   the ``cd`` command) to the directory where :ref:`django-admin.py
    51    <ref-django-admin>` is installed, then run the command 
     51   <ref-django-admin>` is installed, then run the command
    5252   ``chmod +x django-admin.py``.
    5353
    5454.. note::
    These files are: 
    9090    * :file:`__init__.py`: An empty file that tells Python that this directory
    9191      should be considered a Python package. (Read `more about packages`_ in the
    9292      official Python docs if you're a Python beginner.)
    93      
     93
    9494    * :file:`manage.py`: A command-line utility that lets you interact with this
    9595      Django project in various ways. You can read all the details about
    9696      :file:`manage.py` in :ref:`ref-django-admin`.
    97      
     97
    9898    * :file:`settings.py`: Settings/configuration for this Django project.
    9999      :ref:`topics-settings` will tell you all about how settings work.
    100    
     100
    101101    * :file:`urls.py`: The URL declarations for this Django project; a "table of
    102102      contents" of your Django-powered site. You can read more about URLs in
    103103      :ref:`topics-http-urls`.
    It worked! 
    137137    on port 8000. If you want to change the server's port, pass it as a
    138138    command-line argument. For instance, this command starts the server on port
    139139    8080:
    140    
     140
    141141    .. code-block:: bash
    142142
    143143        python manage.py runserver 8080
    database's connection parameters: 
    155155
    156156    * :setting:`DATABASE_ENGINE` -- Either 'postgresql_psycopg2', 'mysql' or
    157157      'sqlite3'. Other backends are :setting:`also available <DATABASE_ENGINE>`.
    158      
     158
    159159    * :setting:`DATABASE_NAME` -- The name of your database. If you're using
    160160      SQLite, the database will be a file on your computer; in that case,
    161161      ``DATABASE_NAME`` should be the full absolute path, including filename, of
    162162      that file. If the file doesn't exist, it will automatically be created
    163163      when you synchronize the database for the first time (see below).
    164      
     164      When specifying the path, always use forward slashes, even on Windows
     165      (e.g. ``C:/homes/user/mysite/sqlite3.db``).
     166
    165167    * :setting:`DATABASE_USER` -- Your database username (not used for SQLite).
    166    
     168
    167169    * :setting:`DATABASE_PASSWORD` -- Your database password (not used for
    168170      SQLite).
    169    
     171
    170172    * :setting:`DATABASE_HOST` -- The host your database is on. Leave this as an
    171173      empty string if your database server is on the same physical machine (not
    172174      used for SQLite).
    prompt, but also because objects' repres 
    582584prompt, but also because objects' representations are used throughout Django's
    583585automatically-generated admin.
    584586
    585 .. admonition:: Why :meth:`~django.db.models.Model.__unicode__` and not 
     587.. admonition:: Why :meth:`~django.db.models.Model.__unicode__` and not
    586588                :meth:`django.db.models.Model.__str__`?
    587589
    588590    If you're familiar with Python, you might be in the habit of adding
  • docs/ref/databases.txt

    diff -r 6469880f5067 docs/ref/databases.txt
    a b Connecting to the database 
    159159Connecting to the database
    160160--------------------------
    161161
    162 Refer to the :ref:`settings documentation <ref-settings>`. 
     162Refer to the :ref:`settings documentation <ref-settings>`.
    163163
    164164Connection settings are used in this order:
    165165
    matter unless you're printing out the fi 
    242242
    243243.. _sqlite-notes:
    244244
    245 SQLite notes 
    246 ============ 
    247  
    248 Versions of SQLite 3.3.5 and older `contain a bug`_ when handling ``ORDER BY``
    249 parameters. This can cause problems when you use the ``select`` parameter for
    250 the ``extra()`` QuerySet method. The bug can be identified by the error message
    251 ``OperationalError: ORDER BY terms must not be non-integer constants``. The
    252 problem can be solved updating SQLite to version 3.3.6 or newer, possibly also
    253 updating the ``pysqlite2`` Python module in the process.
    254  
    255 .. _contain a bug: http://www.sqlite.org/cvstrac/tktview?tn=1768
    256  
    257 This has a very low impact because 3.3.6 was released in April 2006, so most 
    258 current binary distributions for different platforms include newer version of 
    259 SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3`` 
    260 modules. 
    261  
    262 However, in the case of Windows, the official binary distribution of the stable 
    263 release of Python 2.5 (2.5.2, as of this writing) includes SQLite 3.3.4, so the bug can 
    264 make itself evident in that platform. There are (as of Django 1.0) even three 
    265 tests in the Django test suite that will fail when run under this setup.  As 
    266 described above, this can be solved by downloading and installing a newer 
    267 version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and 
    268 uses a newer version of SQLite. Python 2.6 ships with a newer version of 
    269 SQLite and is not be affected by this issue.
    270  
    271 If you are in such platform and find yourself in the need to update 
    272 ``pysqlite``/SQLite, you will also need to manually modify the 
    273 ``django/db/backends/sqlite3/base.py`` file in the Django source tree so it 
    274 attempts to import ``pysqlite2`` before that ``sqlite3`` and so it can take
     245SQLite notes
     246============
     247
     248Versions of SQLite 3.3.5 and older contain a `bug`_ in the handling of
     249``ORDER BY`` parameters. This can cause problems when you use the ``select``
     250parameter of the ``extra()`` QuerySet method. The bug can be identified by the
     251error message ``"OperationalError: ORDER BY terms must not be non-integer
     252constants"``. The problem can be solved updating SQLite to version 3.3.6 or
     253newer, possibly also updating the ``pysqlite2`` Python module in the process.
     254
     255.. _bug: http://www.sqlite.org/cvstrac/tktview?tn=1768
     256
     257This has a very low impact because 3.3.6 was released in April 2006, so most
     258current binary distributions for different platforms include newer version of
     259SQLite usable from Python through either the ``pysqlite2`` or the ``sqlite3``
     260modules.
     261
     262However, in the case of Windows, the official binary distribution of the stable
     263release of Python 2.5 (2.5.2, as of this writing) includes SQLite 3.3.4, so the bug can
     264make itself evident in that platform. There are (as of Django 1.0) even three
     265tests in the Django test suite that will fail when run under this setup.  As
     266described above, this can be solved by downloading and installing a newer
     267version of ``pysqlite2`` (``pysqlite-2.x.x.win32-py2.5.exe``) that includes and
     268uses a newer version of SQLite. Python 2.6 ships with a newer version of
     269SQLite and is not affected by this issue.
     270
     271If you are in such platform and find yourself in the need to update
     272``pysqlite``/SQLite, you will also need to manually modify the
     273``django/db/backends/sqlite3/base.py`` file in the Django source tree so it
     274attempts to import ``pysqlite2`` before than ``sqlite3`` and then it can take
    275275advantage of the new ``pysqlite2``/SQLite versions.
    276276
    277277.. _oracle-notes:
    database user must have privileges to ru 
    293293    * CREATE SEQUENCE
    294294    * CREATE PROCEDURE
    295295    * CREATE TRIGGER
    296    
     296
    297297To run Django's test suite, the user needs these *additional* privileges:
    298298
    299299    * CREATE USER
    300300    * DROP USER
    301301    * CREATE TABLESPACE
    302302    * DROP TABLESPACE
    303    
     303
    304304Connecting to the database
    305305--------------------------
    306306
  • docs/ref/generic-views.txt

    diff -r 6469880f5067 docs/ref/generic-views.txt
    a b a date in the *future* are not included  
    198198      specified in ``date_field`` is greater than the current date/time. By
    199199      default, this is ``False``.
    200200
    201     .. versionadded:: 1.0
     201      .. versionadded:: 1.0
    202202
    203203    * ``template_object_name``: Designates the name of the template variable
    204204      to use in the template context. By default, this is ``'latest'``.
    In addition to ``extra_context``, the te 
    224224      ordered in reverse. This is equivalent to
    225225      ``queryset.dates(date_field, 'year')[::-1]``.
    226226
    227     .. versionchanged:: 1.0
    228        The behaviour depending on ``template_object_name`` is new in this version.
     227      .. versionchanged:: 1.0
     228      The behaviour depending on ``template_object_name`` is new in this version.
    229229
    230230    * ``latest``: The ``num_latest`` objects in the system, ordered descending
    231231      by ``date_field``. For example, if ``num_latest`` is ``10``, then
    specify the page number in the URL in on 
    772772
    773773        /objects/?page=3
    774774
    775     * To loop over all the available page numbers, use the ``page_range`` 
    776       variable. You can iterate over the list provided by ``page_range`` 
     775    * To loop over all the available page numbers, use the ``page_range``
     776      variable. You can iterate over the list provided by ``page_range``
    777777      to create a link to every page of results.
    778778
    779779These values and lists are 1-based, not 0-based, so the first page would be
    780 represented as page ``1``. 
     780represented as page ``1``.
    781781
    782782For more on pagination, read the :ref:`pagination documentation
    783783<topics-pagination>`.
    As a special case, you are also permitte 
    789789
    790790    /objects/?page=last
    791791
    792 This allows you to access the final page of results without first having to 
     792This allows you to access the final page of results without first having to
    793793determine how many pages there are.
    794794
    795795Note that ``page`` *must* be either a valid page number or the value ``last``;
    library <topics-forms-index>` to build a 
    880880**Description:**
    881881
    882882A page that displays a form for creating an object, redisplaying the form with
    883 validation errors (if there are any) and saving the object. 
     883validation errors (if there are any) and saving the object.
    884884
    885885**Required arguments:**
    886886
  • docs/ref/models/querysets.txt

    diff -r 6469880f5067 docs/ref/models/querysets.txt
    a b QuerySet API reference 
    77.. currentmodule:: django.db.models
    88
    99This document describes the details of the ``QuerySet`` API. It builds on the
    10 material presented in the :ref:`model <topics-db-models>` and `database query
    11 <topics-db-queries>` guides, so you'll probably want to read and understand
    12 those documents before reading this one.
     10material presented in the :ref:`model <topics-db-models>` and :ref:`database
     11query <topics-db-queries>` guides, so you'll probably want to read and
     12understand those documents before reading this one.
    1313
    1414Throughout this reference we'll use the :ref:`example weblog models
    1515<queryset-model-example>` presented in the :ref:`database query guide
    respect to case-sensitivity, Django will 
    192192respect to case-sensitivity, Django will order results however your database
    193193backend normally orders them.
    194194
     195``reverse()``
     196~~~~~~~~~~~~~
     197
     198.. versionadded:: 1.0
     199
     200Use the ``reverse()`` method to reverse the order in which a queryset's
     201elements are returned. Calling ``reverse()`` a second time restores the
     202ordering back to the normal direction.
     203
     204To retrieve the ''last'' five items in a queryset, you could do this::
     205
     206    my_queryset.reverse()[:5]
     207
     208Note that this is not quite the same as slicing from the end of a sequence in
     209Python. The above example will return the last item first, then the
     210penultimate item and so on. If we had a Python sequence and looked at
     211``seq[-5:]``, we would see the fifth-last item first. Django doesn't support
     212that mode of access (slicing from the end), because it's not possible to do it
     213efficiently in SQL.
     214
    195215Also, note that ``reverse()`` should generally only be called on a
    196216``QuerySet`` which has a defined ordering (e.g., when querying against
    197217a model which defines a default ordering, or when using
    a model which defines a default ordering 
    199219``QuerySet``, calling ``reverse()`` on it has no real effect (the
    200220ordering was undefined prior to calling ``reverse()``, and will remain
    201221undefined afterward).
    202 
    203222
    204223``distinct()``
    205224~~~~~~~~~~~~~~
    Examples:: 
    392411
    393412    >>> Entry.objects.none()
    394413    []
     414
     415``all()``
     416~~~~~~~~~~
     417
     418.. versionadded:: 1.0
     419
     420Returns a ''copy'' of the current ``QuerySet`` (or ``QuerySet`` subclass you
     421pass in). This can be useful in some situations where you might want to pass
     422in either a model manager or a ``QuerySet`` and do further filtering on the
     423result. You can safely call ``all()`` on either object and then you'll
     424definitely have a ``QuerySet`` to work with.
    395425
    396426.. _select-related:
    397427
  • docs/ref/settings.txt

    diff -r 6469880f5067 docs/ref/settings.txt
    a b default port. Not used with SQLite. 
    224224default port. Not used with SQLite.
    225225
    226226.. setting:: DATABASE_USER
    227    
     227
    228228DATABASE_USER
    229229-------------
    230230
    and ``MONTH_DAY_FORMAT``. 
    247247and ``MONTH_DAY_FORMAT``.
    248248
    249249.. setting:: DATETIME_FORMAT
    250    
     250
    251251DATETIME_FORMAT
    252252---------------
    253253
    system's standard umask. 
    515515.. warning::
    516516
    517517    **Always prefix the mode with a 0.**
    518    
     518
    519519    If you're not familiar with file modes, please note that the leading
    520520    ``0`` is very important: it indicates an octal number, which is the
    521521    way that modes must be specified. If you try to use ``644``, you'll
    522522    get totally incorrect behavior.
    523    
    524523
    525 .. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
     524
     525.. _documentation for os.chmod: http://docs.python.org/lib/os-file-dir.html
    526526
    527527.. setting:: FIXTURE_DIRS
    528528
    Normally, Django sets the ``os.environ[' 
    11521152Normally, Django sets the ``os.environ['TZ']`` variable to the time zone you
    11531153specify in the ``TIME_ZONE`` setting. Thus, all your views and models will
    11541154automatically operate in the correct time zone. However, if you're using the
    1155 manual configuration option (see below), Django will *not* touch the ``TZ``
    1156 environment variable, and it'll be up to you to ensure your processes are
    1157 running in the correct environment.
     1155manual configuration option (see :ref:`Using settings without setting DJANGO
     1156SETTINGS_MODULE <settings-without-django-settings-module>`), Django will *not*
     1157touch the ``TZ`` environment variable, and it'll be up to you to ensure your
     1158processes are running in the correct environment.
    11581159
    11591160.. note::
    11601161    Django cannot reliably use alternate time zones in a Windows environment.
    11611162    If you're running Django on Windows, this variable must be set to match the
    11621163    system timezone.
    1163    
     1164
    11641165.. _See available choices: http://www.postgresql.org/docs/8.1/static/datetime-keywords.html#DATETIME-TIMEZONE-SET-TABLE
    11651166
    11661167.. setting:: URL_VALIDATOR_USER_AGENT
  • docs/topics/i18n.txt

    diff -r 6469880f5067 docs/topics/i18n.txt
    a b If you don't like the verbose name ``uge 
    184184    class MyThing(models.Model):
    185185        name = models.CharField(help_text=_('This is the help text'))
    186186
    187 Always use lazy translations in :ref:`Django models <topics-db-models>`. It's a
    188 good idea to add translations for the field names and table names, too. This
    189 means writing explicit ``verbose_name`` and ``verbose_name_plural`` options in
    190 the ``Meta`` class, though::
     187Always use lazy translations in :ref:`Django models <topics-db-models>`. Field
     188names and table names must be marked for translation otherwise, for example,
     189they will not be translated in the admin interface. This means writing explicit
     190``verbose_name`` and ``verbose_name_plural`` options in the ``Meta`` class,
     191though:
    191192
    192193    from django.utils.translation import ugettext_lazy as _
    193194
    Each ``RequestContext`` has access to th 
    277278
    278279    * ``LANGUAGE_CODE`` is the current user's preferred language, as a string.
    279280      Example: ``en-us``. (See "How language preference is discovered", below.)
    280      
     281
    281282    * ``LANGUAGE_BIDI`` is the current locale's direction. If True, it's a
    282283      right-to-left language, e.g.: Hebrew, Arabic. If False it's a
    283284      left-to-right language, e.g.: English, French, German etc.
    following this algorithm: 
    591592
    592593    * First, it looks for a ``django_language`` key in the current user's
    593594      session.
    594    
     595
    595596    * Failing that, it looks for a cookie.
    596    
     597
    597598      .. versionchanged:: 1.0
    598    
     599
    599600      In Django version 0.96 and before, the cookie's name is hard-coded to
    600601      ``django_language``. In Django 1,0, The cookie name is set by the
    601602      ``LANGUAGE_COOKIE_NAME`` setting. (The default name is
    602603      ``django_language``.)
    603    
     604
    604605    * Failing that, it looks at the ``Accept-Language`` HTTP header. This
    605606      header is sent by your browser and tells the server which language(s) you
    606607      prefer, in order by priority. Django tries each language in the header
    607608      until it finds one with available translations.
    608    
     609
    609610    * Failing that, it uses the global ``LANGUAGE_CODE`` setting.
    610611
    611612.. _locale-middleware-notes:
    Notes: 
    615616    * In each of these places, the language preference is expected to be in the
    616617      standard language format, as a string. For example, Brazilian Portuguese
    617618      is ``pt-br``.
    618    
     619
    619620    * If a base language is available but the sublanguage specified is not,
    620621      Django uses the base language. For example, if a user specifies ``de-at``
    621622      (Austrian German) but Django only has ``de`` available, Django uses
    622623      ``de``.
    623    
     624
    624625    * Only languages listed in the :setting:`LANGUAGES` setting can be selected.
    625626      If you want to restrict the language selection to a subset of provided
    626627      languages (because your application doesn't provide all those languages),
Back to Top