Ticket #15992: 15992.5.patch
File 15992.5.patch, 52.7 KB (added by , 13 years ago) |
---|
-
docs/internals/contributing/writing-code/unit-tests.txt
85 85 86 86 You will also need to ensure that your database uses UTF-8 as the default 87 87 character set. If your database server doesn't use UTF-8 as a default charset, 88 you will need to include a value for ``TEST_CHARSET`` in the settings88 you will need to include a value for :setting:`TEST_CHARSET` in the settings 89 89 dictionary for the applicable database. 90 90 91 91 Running only some of the tests -
docs/internals/deprecation.txt
170 170 and :class:`django.contrib.auth.context_processors.PermLookupDict`, 171 171 respectively. 172 172 173 * The ``MEDIA_URL`` or ``STATIC_URL`` settings are required to end174 with a trailing slash to ensure there is a consistent way to175 combine paths in templates.173 * The :setting:`MEDIA_URL` or :setting:`STATIC_URL` settings are 174 required to end with a trailing slash to ensure there is a consistent 175 way to combine paths in templates. 176 176 177 177 * 1.6 178 178 * The compatibility modules ``django.utils.copycompat`` and -
docs/howto/i18n.txt
55 55 56 56 All message file repositories are structured the same way. They are: 57 57 58 * All paths listed in ``LOCALE_PATHS`` in your settings file are58 * All paths listed in :setting:`LOCALE_PATHS` in your settings file are 59 59 searched for ``<language>/LC_MESSAGES/django.(po|mo)`` 60 60 * ``$PROJECTPATH/locale/<language>/LC_MESSAGES/django.(po|mo)`` -- 61 61 deprecated, see above. -
docs/topics/http/file-uploads.txt
225 225 226 226 When a user uploads a file, Django passes off the file data to an *upload 227 227 handler* -- a small class that handles file data as it gets uploaded. Upload 228 handlers are initially defined in the ``FILE_UPLOAD_HANDLERS`` setting, which228 handlers are initially defined in the :setting:`FILE_UPLOAD_HANDLERS` setting, which 229 229 defaults to:: 230 230 231 231 ("django.core.files.uploadhandler.MemoryFileUploadHandler", … … 246 246 Sometimes particular views require different upload behavior. In these cases, 247 247 you can override upload handlers on a per-request basis by modifying 248 248 ``request.upload_handlers``. By default, this list will contain the upload 249 handlers given by ``FILE_UPLOAD_HANDLERS``, but you can modify the list as you249 handlers given by :setting:`FILE_UPLOAD_HANDLERS`, but you can modify the list as you 250 250 would any other list. 251 251 252 252 For instance, suppose you've written a ``ProgressBarUploadHandler`` that -
docs/topics/http/sessions.txt
23 23 has ``SessionMiddleware`` activated. 24 24 25 25 If you don't want to use sessions, you might as well remove the 26 ``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES`` and26 ``SessionMiddleware`` line from :setting:`MIDDLEWARE_CLASSES` and 27 27 ``'django.contrib.sessions'`` from your :setting:`INSTALLED_APPS`. 28 28 It'll save you a small bit of overhead. 29 29 … … 39 39 ------------------------------ 40 40 41 41 If you want to use a database-backed session, you need to add 42 ``'django.contrib.sessions'`` to your ``INSTALLED_APPS`` setting.42 ``'django.contrib.sessions'`` to your :setting:`INSTALLED_APPS` setting. 43 43 44 44 Once you have configured your installation, run ``manage.py syncdb`` 45 45 to install the single database table that stores session data. … … 359 359 database on every single request. 360 360 361 361 Note that the session cookie is only sent when a session has been created or 362 modified. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, the session cookie363 will be sent on every request.362 modified. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, the session 363 cookie will be sent on every request. 364 364 365 365 Similarly, the ``expires`` part of a session cookie is updated each time the 366 366 session cookie is sent. … … 372 372 persistent sessions with the :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` 373 373 setting. 374 374 375 By default, ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``False``, which376 means session cookies will be stored in users' browsers for as long as375 By default, :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``False``, 376 which means session cookies will be stored in users' browsers for as long as 377 377 :setting:`SESSION_COOKIE_AGE`. Use this if you don't want people to have to 378 378 log in every time they open a browser. 379 379 380 If ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``True``, Django will use380 If :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``True``, Django will use 381 381 browser-length cookies -- cookies that expire as soon as the user closes his or 382 382 her browser. Use this if you want people to have to log in every time they open 383 383 a browser. -
docs/topics/http/views.txt
48 48 49 49 .. admonition:: Django's Time Zone 50 50 51 Django includes a ``TIME_ZONE`` setting that defaults to51 Django includes a :setting:`TIME_ZONE` setting that defaults to 52 52 ``America/Chicago``. This probably isn't where you live, so you might want 53 53 to change it in your settings file. 54 54 -
docs/topics/i18n/internationalization.txt
674 674 ) 675 675 676 676 Each string in ``packages`` should be in Python dotted-package syntax (the 677 same format as the strings in ``INSTALLED_APPS``) and should refer to a package677 same format as the strings in :setting:`INSTALLED_APPS`) and should refer to a package 678 678 that contains a ``locale`` directory. If you specify multiple packages, all 679 679 those catalogs are merged into one catalog. This is useful if you have 680 680 JavaScript that uses strings from different applications. … … 707 707 later. 708 708 709 709 .. versionchanged:: 1.3 710 Directories listed in ``LOCALE_PATHS`` weren't included in the lookup710 Directories listed in :setting:`LOCALE_PATHS` weren't included in the lookup 711 711 algorithm until version 1.3. 712 712 713 713 Using the JavaScript translation catalog -
docs/topics/i18n/deployment.txt
13 13 optimizations so as not to load the internationalization machinery. 14 14 15 15 You'll probably also want to remove ``'django.core.context_processors.i18n'`` 16 from your ``TEMPLATE_CONTEXT_PROCESSORS`` setting.16 from your :setting:`TEMPLATE_CONTEXT_PROCESSORS` setting. 17 17 18 18 .. note:: 19 19 … … 47 47 other translator finds a translation. 48 48 49 49 If all you want to do is run Django with your native language, and a language 50 file is available for it, all you need to do is set ``LANGUAGE_CODE``.50 file is available for it, all you need to do is set :setting:`LANGUAGE_CODE`. 51 51 52 52 If you want to let each individual user specify which language he or she 53 53 prefers, use ``LocaleMiddleware``. ``LocaleMiddleware`` enables language 54 54 selection based on data from the request. It customizes content for each user. 55 55 56 56 To use ``LocaleMiddleware``, add ``'django.middleware.locale.LocaleMiddleware'`` 57 to your ``MIDDLEWARE_CLASSES`` setting. Because middleware order matters, you57 to your :setting:`MIDDLEWARE_CLASSES` setting. Because middleware order matters, you 58 58 should follow these guidelines: 59 59 60 60 * Make sure it's one of the first middlewares installed. … … 62 62 makes use of session data. 63 63 * If you use ``CacheMiddleware``, put ``LocaleMiddleware`` after it. 64 64 65 For example, your ``MIDDLEWARE_CLASSES`` might look like this::65 For example, your :setting:`MIDDLEWARE_CLASSES` might look like this:: 66 66 67 67 MIDDLEWARE_CLASSES = ( 68 68 'django.contrib.sessions.middleware.SessionMiddleware', … … 81 81 82 82 * Failing that, it looks for a cookie. 83 83 84 The name of the cookie used is set by the ``LANGUAGE_COOKIE_NAME``84 The name of the cookie used is set by the :setting:`LANGUAGE_COOKIE_NAME` 85 85 setting. (The default name is ``django_language``.) 86 86 87 87 * Failing that, it looks at the ``Accept-Language`` HTTP header. This … … 89 89 prefer, in order by priority. Django tries each language in the header 90 90 until it finds one with available translations. 91 91 92 * Failing that, it uses the global ``LANGUAGE_CODE`` setting.92 * Failing that, it uses the global :setting:`LANGUAGE_CODE` setting. 93 93 94 94 .. _locale-middleware-notes: 95 95 … … 107 107 * Only languages listed in the :setting:`LANGUAGES` setting can be selected. 108 108 If you want to restrict the language selection to a subset of provided 109 109 languages (because your application doesn't provide all those languages), 110 set ``LANGUAGES`` to a list of languages. For example::110 set :setting:`LANGUAGES` to a list of languages. For example:: 111 111 112 112 LANGUAGES = ( 113 113 ('de', _('German')), … … 118 118 selection to German and English (and any sublanguage, like de-ch or 119 119 en-us). 120 120 121 * If you define a custom ``LANGUAGES`` setting, as explained in the121 * If you define a custom :setting:`LANGUAGES` setting, as explained in the 122 122 previous bullet, it's OK to mark the languages as translation strings 123 123 -- but use a "dummy" ``ugettext()`` function, not the one in 124 124 ``django.utils.translation``. You should *never* import … … 139 139 With this arrangement, ``django-admin.py makemessages`` will still find 140 140 and mark these strings for translation, but the translation won't happen 141 141 at runtime -- so you'll have to remember to wrap the languages in the 142 *real* ``ugettext()`` in any code that uses ``LANGUAGES`` at runtime.142 *real* ``ugettext()`` in any code that uses :setting:`LANGUAGES` at runtime. 143 143 144 144 * The ``LocaleMiddleware`` can only select languages for which there is a 145 145 Django-provided base translation. If you want to provide translations -
docs/topics/cache.txt
420 420 entire site. You'll need to add 421 421 ``'django.middleware.cache.UpdateCacheMiddleware'`` and 422 422 ``'django.middleware.cache.FetchFromCacheMiddleware'`` to your 423 ``MIDDLEWARE_CLASSES`` setting, as in this example::423 :setting:`MIDDLEWARE_CLASSES` setting, as in this example:: 424 424 425 425 MIDDLEWARE_CLASSES = ( 426 426 'django.middleware.cache.UpdateCacheMiddleware', -
docs/topics/testing.txt
383 383 Aside from using a separate database, the test runner will otherwise 384 384 use all of the same database settings you have in your settings file: 385 385 :setting:`ENGINE`, :setting:`USER`, :setting:`HOST`, etc. The test 386 database is created by the user specified by ``USER``, so you'll need386 database is created by the user specified by :setting:`USER`, so you'll need 387 387 to make sure that the given user account has sufficient privileges to 388 388 create a new database on the system. 389 389 … … 1309 1309 ``django.test.TestCase`` provides the ability to customize the URLconf 1310 1310 configuration for the duration of the execution of a test suite. If your 1311 1311 ``TestCase`` instance defines an ``urls`` attribute, the ``TestCase`` will use 1312 the value of that attribute as the ``ROOT_URLCONF`` for the duration of that1312 the value of that attribute as the :setting:`ROOT_URLCONF` for the duration of that 1313 1313 test. 1314 1314 1315 1315 For example:: -
docs/topics/logging.txt
486 486 The ``include_html`` argument of ``AdminEmailHandler`` is used to 487 487 control whether the traceback email includes an HTML attachment 488 488 containing the full content of the debug Web page that would have been 489 produced if ``DEBUG`` were ``True``. To set this value in your489 produced if :setting:`DEBUG` were ``True``. To set this value in your 490 490 configuration, include it in the handler definition for 491 491 ``django.utils.log.AdminEmailHandler``, like this:: 492 492 -
docs/topics/email.txt
509 509 ------------------------------- 510 510 511 511 If you need to change how emails are sent you can write your own email 512 backend. The ``EMAIL_BACKEND`` setting in your settings file is then the512 backend. The :setting:`EMAIL_BACKEND` setting in your settings file is then the 513 513 Python import path for your backend class. 514 514 515 515 Custom email backends should subclass ``BaseEmailBackend`` that is located in -
docs/topics/templates.txt
101 101 ``title`` attribute of the ``section`` object. 102 102 103 103 If you use a variable that doesn't exist, the template system will insert 104 the value of the ``TEMPLATE_STRING_IF_INVALID`` setting, which is set to ``''``104 the value of the :setting:`TEMPLATE_STRING_IF_INVALID` setting, which is set to ``''`` 105 105 (the empty string) by default. 106 106 107 107 Filters -
docs/topics/settings.txt
209 209 first positional argument) in the call to ``configure()``. 210 210 211 211 In this example, default settings are taken from ``myapp_defaults``, and the 212 ``DEBUG`` setting is set to ``True``, regardless of its value in212 :setting:`DEBUG` setting is set to ``True``, regardless of its value in 213 213 ``myapp_defaults``:: 214 214 215 215 from django.conf import settings -
docs/releases/1.3.txt
264 264 :ref:`running the Django test suite <running-unit-tests>` with ``runtests.py`` 265 265 when using :ref:`spatial database backends <spatial-backends>`. 266 266 267 ``MEDIA_URL`` and ``STATIC_URL`` must end in a slash268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 267 :setting:`MEDIA_URL` and :setting:`STATIC_URL` must end in a slash 268 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 269 269 270 270 Previously, the :setting:`MEDIA_URL` setting only required a trailing slash if 271 271 it contained a suffix beyond the domain name. … … 581 581 582 582 * Now it is possible to override the translations shipped with applications by 583 583 using the :setting:`LOCALE_PATHS` setting whose translations have now higher 584 precedence than the translations of ``INSTALLED_APPS`` applications.584 precedence than the translations of :setting:`INSTALLED_APPS` applications. 585 585 The relative priority among the values listed in this setting has also been 586 586 modified so the paths listed first have higher precedence than the 587 587 ones listed later. … … 589 589 * The ``locale`` subdirectory of the directory containing the settings, that 590 590 usually coincides with and is know as the *project directory* is being 591 591 deprecated in this release as a source of translations. (the precedence of 592 these translations is intermediate between applications and ``LOCALE_PATHS``592 these translations is intermediate between applications and :setting:`LOCALE_PATHS` 593 593 translations). See the `corresponding deprecated features section`_ 594 594 of this document. 595 595 -
docs/releases/1.0-porting-guide.txt
443 443 Django fails to find the settings module and a :exc:`RuntimeError` when you try 444 444 to reconfigure settings after having already used them 445 445 446 ``LOGIN_URL`` has moved447 ~~~~~~~~~~~~~~~~~~~~~~~ 446 :setting:`LOGIN_URL` has moved 447 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 448 448 449 The ``LOGIN_URL`` constant moved from ``django.contrib.auth`` into the449 The :setting:`LOGIN_URL` constant moved from ``django.contrib.auth`` into the 450 450 ``settings`` module. Instead of using ``from django.contrib.auth import 451 451 LOGIN_URL`` refer to :setting:`settings.LOGIN_URL <LOGIN_URL>`. 452 452 … … 454 454 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 455 455 456 456 In 0.96, if a URL didn't end in a slash or have a period in the final 457 component of its path, and ``APPEND_SLASH`` was True, Django would redirect457 component of its path, and :setting:`APPEND_SLASH` was True, Django would redirect 458 458 to the same URL, but with a slash appended to the end. Now, Django checks to 459 459 see whether the pattern without the trailing slash would be matched by 460 460 something in your URL patterns. If so, no redirection takes place, because it … … 548 548 **Back up your database first!** 549 549 550 550 For SQLite, this means making a copy of the single file that stores the 551 database (the name of that file is the ``DATABASE_NAME`` in your settings.py551 database (the name of that file is the :setting:`DATABASE_NAME` in your settings.py 552 552 file). 553 553 554 554 To upgrade each application to use a ``DecimalField``, you can do the -
docs/releases/1.3-alpha-1.txt
249 249 prohibited words an empty list. 250 250 251 251 If you want to restore the old behavior, simply put a 252 ``PROFANITIES_LIST`` setting in your settings file that includes the252 :setting:`PROFANITIES_LIST` setting in your settings file that includes the 253 253 words that you want to prohibit (see the `commit that implemented this 254 254 change`_ if you want to see the list of words that was historically 255 255 prohibited). However, if avoiding profanities is important to you, you -
docs/releases/1.2.txt
1076 1076 to provide localizers the possibility to translate date and time formats. They 1077 1077 were translatable :term:`translation strings <translation string>` that could 1078 1078 be recognized because they were all upper case (for example 1079 ``DATETIME_FORMAT``, ``DATE_FORMAT``, ``TIME_FORMAT``). They have been1079 :setting:`DATETIME_FORMAT`, :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`). They have been 1080 1080 deprecated in favor of the new :ref:`Format localization 1081 1081 <format-localization>` infrastructure that allows localizers to specify that 1082 1082 information in a ``formats.py`` file in the corresponding -
docs/faq/models.txt
6 6 How can I see the raw SQL queries Django is running? 7 7 ---------------------------------------------------- 8 8 9 Make sure your Django ``DEBUG`` setting is set to ``True``. Then, just do9 Make sure your Django :setting:`DEBUG` setting is set to ``True``. Then, just do 10 10 this:: 11 11 12 12 >>> from django.db import connection … … 14 14 [{'sql': 'SELECT polls_polls.id,polls_polls.question,polls_polls.pub_date FROM polls_polls', 15 15 'time': '0.002'}] 16 16 17 ``connection.queries`` is only available if ``DEBUG`` is ``True``. It's a list17 ``connection.queries`` is only available if :setting:`DEBUG` is ``True``. It's a list 18 18 of dictionaries in order of query execution. Each dictionary has the following:: 19 19 20 20 ``sql`` -- The raw SQL statement … … 89 89 90 90 Django isn't known to leak memory. If you find your Django processes are 91 91 allocating more and more memory, with no sign of releasing it, check to make 92 sure your ``DEBUG`` setting is set to ``False``. If ``DEBUG`` is ``True``, then92 sure your :setting:`DEBUG` setting is set to ``False``. If :setting:`DEBUG` is ``True``, then 93 93 Django saves a copy of every SQL statement it has executed. 94 94 95 95 (The queries are saved in ``django.db.connection.queries``. See 96 96 `How can I see the raw SQL queries Django is running?`_.) 97 97 98 To fix the problem, set ``DEBUG`` to ``False``.98 To fix the problem, set :setting:`DEBUG` to ``False``. 99 99 100 100 If you need to clear the query list manually at any point in your functions, 101 101 just call ``reset_queries()``, like this:: -
docs/faq/admin.txt
8 8 sent out by Django doesn't match the domain in your browser. Try these two 9 9 things: 10 10 11 * Set the ``SESSION_COOKIE_DOMAIN`` setting in your admin config file11 * Set the :setting:`SESSION_COOKIE_DOMAIN` setting in your admin config file 12 12 to match your domain. For example, if you're going to 13 13 "http://www.example.com/admin/" in your browser, in 14 14 "myproject.settings" you should set ``SESSION_COOKIE_DOMAIN = 'www.example.com'``. … … 17 17 don't have dots in them. If you're running the admin site on "localhost" 18 18 or another domain that doesn't have a dot in it, try going to 19 19 "localhost.localdomain" or "127.0.0.1". And set 20 ``SESSION_COOKIE_DOMAIN`` accordingly.20 :setting:`SESSION_COOKIE_DOMAIN` accordingly. 21 21 22 22 I can't log in. When I enter a valid username and password, it brings up the login page again, with a "Please enter a correct username and password" error. 23 23 ----------------------------------------------------------------------------------------------------------------------------------------------------------- -
docs/ref/generic-views.txt
58 58 just before rendering the template. 59 59 60 60 * ``mimetype``: The MIME type to use for the resulting document. Defaults 61 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.61 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 62 62 63 63 **Example:** 64 64 … … 198 198 the view's template. 199 199 200 200 * ``mimetype``: The MIME type to use for the resulting document. Defaults 201 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.201 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 202 202 203 203 * ``allow_future``: A boolean specifying whether to include "future" 204 204 objects on this page, where "future" means objects in which the field … … 290 290 this is ``False``. 291 291 292 292 * ``mimetype``: The MIME type to use for the resulting document. Defaults 293 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.293 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 294 294 295 295 * ``allow_future``: A boolean specifying whether to include "future" 296 296 objects on this page, where "future" means objects in which the field … … 377 377 determining the variable's name. 378 378 379 379 * ``mimetype``: The MIME type to use for the resulting document. Defaults 380 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.380 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 381 381 382 382 * ``allow_future``: A boolean specifying whether to include "future" 383 383 objects on this page, where "future" means objects in which the field … … 465 465 determining the variable's name. 466 466 467 467 * ``mimetype``: The MIME type to use for the resulting document. Defaults 468 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.468 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 469 469 470 470 * ``allow_future``: A boolean specifying whether to include "future" 471 471 objects on this page, where "future" means objects in which the field … … 550 550 determining the variable's name. 551 551 552 552 * ``mimetype``: The MIME type to use for the resulting document. Defaults 553 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.553 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 554 554 555 555 * ``allow_future``: A boolean specifying whether to include "future" 556 556 objects on this page, where "future" means objects in which the field … … 660 660 to use in the template context. By default, this is ``'object'``. 661 661 662 662 * ``mimetype``: The MIME type to use for the resulting document. Defaults 663 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.663 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 664 664 665 665 * ``allow_future``: A boolean specifying whether to include "future" 666 666 objects on this page, where "future" means objects in which the field … … 738 738 determining the variable's name. 739 739 740 740 * ``mimetype``: The MIME type to use for the resulting document. Defaults 741 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.741 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 742 742 743 743 **Template name:** 744 744 … … 852 852 to use in the template context. By default, this is ``'object'``. 853 853 854 854 * ``mimetype``: The MIME type to use for the resulting document. Defaults 855 to the value of the ``DEFAULT_CONTENT_TYPE`` setting.855 to the value of the :setting:`DEFAULT_CONTENT_TYPE` setting. 856 856 857 857 **Template name:** 858 858 -
docs/ref/forms/fields.txt
764 764 .. attribute:: URLField.validator_user_agent 765 765 766 766 String used as the user-agent used when checking for a URL's existence. 767 Defaults to the value of the ``URL_VALIDATOR_USER_AGENT`` setting.767 Defaults to the value of the :setting:`URL_VALIDATOR_USER_AGENT` setting. 768 768 769 769 .. versionchanged:: 1.2 770 770 The URLField previously did not recognize URLs as valid that contained an IDN -
docs/ref/templates/builtins.txt
1307 1307 ``datetime.datetime.now()``), the output will be the string 1308 1308 ``'Wed 09 Jan 2008'``. 1309 1309 1310 The format passed can be one of the predefined ones ``DATE_FORMAT``,1311 ``DATETIME_FORMAT``, ``SHORT_DATE_FORMAT`` or ``SHORT_DATETIME_FORMAT``, or a1310 The format passed can be one of the predefined ones :setting:`DATE_FORMAT`, 1311 :setting:`DATETIME_FORMAT`, :setting:`SHORT_DATE_FORMAT` or :setting:`SHORT_DATETIME_FORMAT`, or a 1312 1312 custom format that uses the format specifiers shown in the table above. Note 1313 1313 that predefined formats may vary depending on the current locale. 1314 1314 … … 1941 1941 1942 1942 Formats a time according to the given format. 1943 1943 1944 Given format can be the predefined one ``TIME_FORMAT``, or a custom format,1944 Given format can be the predefined one :setting:`TIME_FORMAT`, or a custom format, 1945 1945 same as the :tfilter:`date` filter. Note that the predefined format is locale- 1946 1946 dependant. 1947 1947 … … 2243 2243 ------------------------------- 2244 2244 2245 2245 Django comes with a couple of other template-tag libraries that you have to 2246 enable explicitly in your ``INSTALLED_APPS`` setting and enable in your2246 enable explicitly in your :setting:`INSTALLED_APPS` setting and enable in your 2247 2247 template with the ``{% load %}`` tag. 2248 2248 2249 2249 django.contrib.humanize … … 2274 2274 2275 2275 Provides a couple of templatetags that allow specifying translatable text in 2276 2276 Django templates. It is slightly different from the libraries described 2277 above because you don't need to add any application to the ``INSTALLED_APPS``2277 above because you don't need to add any application to the :setting:`INSTALLED_APPS` 2278 2278 setting but rather set :setting:`USE_I18N` to True, then loading it with 2279 2279 ``{% load i18n %}``. See :ref:`specifying-translation-strings-in-template-code`. 2280 2280 … … 2283 2283 2284 2284 Provides a couple of templatetags that allow control over the localization of 2285 2285 values in Django templates. It is slightly different from the libraries described 2286 above because you don't need to add any application to the ``INSTALLED_APPS``;2286 above because you don't need to add any application to the :setting:`INSTALLED_APPS`; 2287 2287 you only need to load the library using ``{% load l10n %}``. See 2288 2288 :ref:`topic-l10n-templates`. -
docs/ref/contrib/gis/geoip.txt
18 18 datasets in binary format (the CSV files will not work!). These datasets may be 19 19 `downloaded from MaxMind`__. Grab the ``GeoIP.dat.gz`` and ``GeoLiteCity.dat.gz`` 20 20 and unzip them in a directory corresponding to what you set 21 ``GEOIP_PATH`` with in your settings. See the example and reference below21 :setting:`GEOIP_PATH` with in your settings. See the example and reference below 22 22 for more details. 23 23 24 24 __ http://www.maxmind.com/app/c -
docs/ref/contrib/gis/install.txt
592 592 __ http://www.gaia-gis.it/spatialite/resources.html 593 593 594 594 595 Add ``django.contrib.gis`` to ``INSTALLED_APPS``596 ------------------------------------------------ 595 Add ``django.contrib.gis`` to :setting:`INSTALLED_APPS` 596 ------------------------------------------------------- 597 597 598 598 Like other Django contrib applications, you will *only* need to add 599 599 :mod:`django.contrib.gis` to :setting:`INSTALLED_APPS` in your settings. -
docs/ref/contrib/messages.txt
386 386 Default: ``None`` 387 387 388 388 The storage backends that use cookies -- ``CookieStorage`` and 389 ``FallbackStorage`` -- use the value of ``SESSION_COOKIE_DOMAIN`` in389 ``FallbackStorage`` -- use the value of :setting:`SESSION_COOKIE_DOMAIN` in 390 390 setting their cookies. See the :doc:`settings documentation </ref/settings>` 391 391 for more information on how this works and why you might need to set it. 392 392 -
docs/ref/contrib/index.txt
14 14 15 15 For most of these add-ons -- specifically, the add-ons that include either 16 16 models or template tags -- you'll need to add the package name (e.g., 17 ``'django.contrib.admin'``) to your ``INSTALLED_APPS`` setting and re-run17 ``'django.contrib.admin'``) to your :setting:`INSTALLED_APPS` setting and re-run 18 18 ``manage.py syncdb``. 19 19 20 20 .. _"batteries included" philosophy: http://docs.python.org/tutorial/stdlib.html#batteries-included -
docs/ref/contrib/admin/index.txt
1765 1765 ) 1766 1766 1767 1767 Above we used ``admin.autodiscover()`` to automatically load the 1768 ``INSTALLED_APPS`` admin.py modules.1768 :setting:`INSTALLED_APPS` admin.py modules. 1769 1769 1770 1770 In this example, we register the ``AdminSite`` instance 1771 1771 ``myproject.admin.admin_site`` at the URL ``/myadmin/`` :: -
docs/ref/databases.txt
262 262 :setting:`HOST`, :setting:`PORT` 263 263 3. MySQL option files. 264 264 265 In other words, if you set the name of the database in ``OPTIONS``,266 this will take precedence over ``NAME``, which would override265 In other words, if you set the name of the database in :setting:`OPTIONS`, 266 this will take precedence over :setting:`NAME`, which would override 267 267 anything in a `MySQL option file`_. 268 268 269 269 Here's a sample configuration which uses a MySQL option file:: … … 574 574 575 575 If you don't use a ``tnsnames.ora`` file or a similar naming method that 576 576 recognizes the SID ("xe" in this example), then fill in both 577 ``HOST`` and ``PORT`` like so::577 :setting:`HOST` and :setting:`PORT` like so:: 578 578 579 579 DATABASES = { 580 580 'default': { … … 587 587 } 588 588 } 589 589 590 You should supply both ``HOST`` and ``PORT``, or leave both590 You should supply both :setting:`HOST` and :setting:`PORT`, or leave both 591 591 as empty strings. 592 592 593 593 Threaded option -
docs/ref/django-admin.txt
57 57 --------- 58 58 59 59 Many commands take a list of "app names." An "app name" is the basename of 60 the package containing your models. For example, if your ``INSTALLED_APPS``60 the package containing your models. For example, if your :setting:`INSTALLED_APPS` 61 61 contains the string ``'mysite.blog'``, the app name is ``blog``. 62 62 63 63 Determining the version … … 126 126 127 127 Runs the command-line client for the database engine specified in your 128 128 ``ENGINE`` setting, with the connection parameters specified in your 129 ``USER``, ``PASSWORD``, etc., settings.129 :setting:`USER`, :setting:`PASSWORD`, etc., settings. 130 130 131 131 * For PostgreSQL, this runs the ``psql`` command-line client. 132 132 * For MySQL, this runs the ``mysql`` command-line client. … … 151 151 settings. 152 152 153 153 Settings that don't appear in the defaults are followed by ``"###"``. For 154 example, the default settings don't define ``ROOT_URLCONF``, so155 ``ROOT_URLCONF`` is followed by ``"###"`` in the output of ``diffsettings``.154 example, the default settings don't define :setting:`ROOT_URLCONF`, so 155 :setting:`ROOT_URLCONF` is followed by ``"###"`` in the output of ``diffsettings``. 156 156 157 157 Note that Django's default settings live in ``django/conf/global_settings.py``, 158 158 if you're ever curious to see the full list of defaults. … … 245 245 .. django-admin:: inspectdb 246 246 247 247 Introspects the database tables in the database pointed-to by the 248 ``NAME`` setting and outputs a Django model module (a ``models.py``248 :setting:`NAME` setting and outputs a Django model module (a ``models.py`` 249 249 file) to standard output. 250 250 251 251 Use this if you have a legacy database with which you'd like to use Django. … … 309 309 Django will search in three locations for fixtures: 310 310 311 311 1. In the ``fixtures`` directory of every installed application 312 2. In any directory named in the ``FIXTURE_DIRS`` setting312 2. In any directory named in the :setting:`FIXTURE_DIRS` setting 313 313 3. In the literal path named by the fixture 314 314 315 315 Django will load any and all fixtures it finds in these locations that match … … 340 340 341 341 would search ``<appname>/fixtures/foo/bar/mydata.json`` for each installed 342 342 application, ``<dirname>/foo/bar/mydata.json`` for each directory in 343 ``FIXTURE_DIRS``, and the literal path ``foo/bar/mydata.json``.343 :setting:`FIXTURE_DIRS`, and the literal path ``foo/bar/mydata.json``. 344 344 345 345 When fixture files are processed, the data is saved to the database as is. 346 346 Model defined ``save`` methods and ``pre_save`` signals are not called. … … 742 742 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 743 743 744 744 By default, the development server doesn't serve any static files for your site 745 (such as CSS files, images, things under ``MEDIA_URL`` and so forth). If745 (such as CSS files, images, things under :setting:`MEDIA_URL` and so forth). If 746 746 you want to configure Django to serve static media, read :doc:`/howto/static-files`. 747 747 748 748 shell … … 912 912 913 913 .. django-admin:: syncdb 914 914 915 Creates the database tables for all apps in ``INSTALLED_APPS`` whose tables915 Creates the database tables for all apps in :setting:`INSTALLED_APPS` whose tables 916 916 have not already been created. 917 917 918 918 Use this command when you've added new applications to your project and want to 919 919 install them in the database. This includes any apps shipped with Django that 920 might be in ``INSTALLED_APPS`` by default. When you start a new project, run920 might be in :setting:`INSTALLED_APPS` by default. When you start a new project, run 921 921 this command to install the default apps. 922 922 923 923 .. admonition:: Syncdb will not alter existing tables … … 1032 1032 1033 1033 .. django-admin:: validate 1034 1034 1035 Validates all installed models (according to the ``INSTALLED_APPS`` setting)1035 Validates all installed models (according to the :setting:`INSTALLED_APPS` setting) 1036 1036 and prints validation errors to standard output. 1037 1037 1038 1038 Commands provided by applications -
docs/ref/settings.txt
86 86 tag. This is a security measure, so that template authors can't access files 87 87 that they shouldn't be accessing. 88 88 89 For example, if ``ALLOWED_INCLUDE_ROOTS`` is ``('/home/html', '/var/www')``,89 For example, if :setting:`ALLOWED_INCLUDE_ROOTS` is ``('/home/html', '/var/www')``, 90 90 then ``{% ssi /home/html/foo.txt %}`` would work, but ``{% ssi /etc/passwd %}`` 91 91 wouldn't. 92 92 … … 102 102 same URL with a slash appended. Note that the redirect may cause any data 103 103 submitted in a POST request to be lost. 104 104 105 The ``APPEND_SLASH`` setting is only used if105 The :setting:`APPEND_SLASH` setting is only used if 106 106 :class:`~django.middleware.common.CommonMiddleware` is installed 107 107 (see :doc:`/topics/http/middleware`). See also :setting:`PREPEND_WWW`. 108 108 … … 634 634 :tfilter:`allowed date format strings <date>`. 635 635 636 636 .. versionchanged:: 1.2 637 This setting can now be overriden by setting ``USE_L10N`` to ``True``.637 This setting can now be overriden by setting :setting:`USE_L10N` to ``True``. 638 638 639 See also ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATE_FORMAT``.639 See also :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATE_FORMAT`. 640 640 641 641 .. setting:: DATE_INPUT_FORMATS 642 642 … … 657 657 syntax, that is different from the one used by Django for formatting dates 658 658 to be displayed. 659 659 660 See also ``DATETIME_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.660 See also :setting:`DATETIME_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`. 661 661 662 662 .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior 663 663 … … 674 674 :tfilter:`allowed date format strings <date>`. 675 675 676 676 .. versionchanged:: 1.2 677 This setting can now be overriden by setting ``USE_L10N`` to ``True``.677 This setting can now be overriden by setting :setting:`USE_L10N` to ``True``. 678 678 679 See also ``DATE_FORMAT``, ``TIME_FORMAT`` and ``SHORT_DATETIME_FORMAT``.679 See also :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`. 680 680 681 681 .. setting:: DATETIME_INPUT_FORMATS 682 682 … … 697 697 syntax, that is different from the one used by Django for formatting dates 698 698 to be displayed. 699 699 700 See also ``DATE_INPUT_FORMATS`` and ``TIME_INPUT_FORMATS``.700 See also :setting:`DATE_INPUT_FORMATS` and :setting:`TIME_INPUT_FORMATS`. 701 701 702 702 .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior 703 703 … … 720 720 are inappropriate for public consumption. File paths, configuration options, and 721 721 the like all give attackers extra information about your server. 722 722 723 It is also important to remember that when running with ``DEBUG`` turned on, Django723 It is also important to remember that when running with :setting:`DEBUG` turned on, Django 724 724 will remember every SQL query it executes. This is useful when you are debugging, 725 725 but on a production server, it will rapidly consume memory. 726 726 727 Never deploy a site into production with ``DEBUG`` turned on.727 Never deploy a site into production with :setting:`DEBUG` turned on. 728 728 729 729 .. _django/views/debug.py: http://code.djangoproject.com/browser/django/trunk/django/views/debug.py 730 730 … … 757 757 Default: ``'utf-8'`` 758 758 759 759 Default charset to use for all ``HttpResponse`` objects, if a MIME type isn't 760 manually specified. Used with ``DEFAULT_CONTENT_TYPE`` to construct the760 manually specified. Used with :setting:`DEFAULT_CONTENT_TYPE` to construct the 761 761 ``Content-Type`` header. 762 762 763 763 .. setting:: DEFAULT_CONTENT_TYPE … … 768 768 Default: ``'text/html'`` 769 769 770 770 Default content type to use for all ``HttpResponse`` objects, if a MIME type 771 isn't manually specified. Used with ``DEFAULT_CHARSET`` to construct the771 isn't manually specified. Used with :setting:`DEFAULT_CHARSET` to construct the 772 772 ``Content-Type`` header. 773 773 774 774 .. setting:: DEFAULT_FILE_STORAGE … … 855 855 856 856 The host to use for sending email. 857 857 858 See also ``EMAIL_PORT``.858 See also :setting:`EMAIL_PORT`. 859 859 860 860 .. setting:: EMAIL_HOST_PASSWORD 861 861 … … 864 864 865 865 Default: ``''`` (Empty string) 866 866 867 Password to use for the SMTP server defined in ``EMAIL_HOST``. This setting is868 used in conjunction with ``EMAIL_HOST_USER`` when authenticating to the SMTP867 Password to use for the SMTP server defined in :setting:`EMAIL_HOST`. This setting is 868 used in conjunction with :setting:`EMAIL_HOST_USER` when authenticating to the SMTP 869 869 server. If either of these settings is empty, Django won't attempt 870 870 authentication. 871 871 872 See also ``EMAIL_HOST_USER``.872 See also :setting:`EMAIL_HOST_USER`. 873 873 874 874 .. setting:: EMAIL_HOST_USER 875 875 … … 878 878 879 879 Default: ``''`` (Empty string) 880 880 881 Username to use for the SMTP server defined in ``EMAIL_HOST``. If empty,881 Username to use for the SMTP server defined in :setting:`EMAIL_HOST`. If empty, 882 882 Django won't attempt authentication. 883 883 884 See also ``EMAIL_HOST_PASSWORD``.884 See also :setting:`EMAIL_HOST_PASSWORD`. 885 885 886 886 .. setting:: EMAIL_PORT 887 887 … … 890 890 891 891 Default: ``25`` 892 892 893 Port to use for the SMTP server defined in ``EMAIL_HOST``.893 Port to use for the SMTP server defined in :setting:`EMAIL_HOST`. 894 894 895 895 .. setting:: EMAIL_SUBJECT_PREFIX 896 896 … … 1037 1037 file, under the directory named as the current locale, and will use the 1038 1038 formats defined on this file. 1039 1039 1040 For example, if ``FORMAT_MODULE_PATH`` is set to ``mysite.formats``, and1040 For example, if :setting:`FORMAT_MODULE_PATH` is set to ``mysite.formats``, and 1041 1041 current language is ``en`` (English), Django will expect a directory tree 1042 1042 like:: 1043 1043 … … 1048 1048 __init__.py 1049 1049 formats.py 1050 1050 1051 Available formats are ``DATE_FORMAT``, ``TIME_FORMAT``, ``DATETIME_FORMAT``, 1052 ``YEAR_MONTH_FORMAT``, ``MONTH_DAY_FORMAT``, ``SHORT_DATE_FORMAT``, 1053 ``SHORT_DATETIME_FORMAT``, ``FIRST_DAY_OF_WEEK``, ``DECIMAL_SEPARATOR``, 1054 ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``. 1051 Available formats are :setting:`DATE_FORMAT`, :setting:`TIME_FORMAT`, 1052 :setting:`DATETIME_FORMAT`, :setting:`YEAR_MONTH_FORMAT`, 1053 :setting:`MONTH_DAY_FORMAT`, :setting:`SHORT_DATE_FORMAT`, 1054 :setting:`SHORT_DATETIME_FORMAT`, :setting:`FIRST_DAY_OF_WEEK`, 1055 :setting:`DECIMAL_SEPARATOR`, :setting:`THOUSAND_SEPARATOR` and 1056 :setting:`NUMBER_GROUPING`. 1055 1057 1056 1058 .. setting:: IGNORABLE_404_URLS 1057 1059 … … 1100 1102 1101 1103 A tuple of IP addresses, as strings, that: 1102 1104 1103 * See debug comments, when ``DEBUG`` is ``True``1105 * See debug comments, when :setting:`DEBUG` is ``True`` 1104 1106 * Receive X headers if the ``XViewMiddleware`` is installed (see 1105 1107 :doc:`/topics/http/middleware`) 1106 1108 … … 1123 1125 Default: ``'django_language'`` 1124 1126 1125 1127 The name of the cookie to use for the language cookie. This can be whatever you 1126 want (but should be different from ``SESSION_COOKIE_NAME``). See1128 want (but should be different from :setting:`SESSION_COOKIE_NAME`). See 1127 1129 :doc:`/topics/i18n/index`. 1128 1130 1129 1131 .. setting:: LANGUAGES … … 1147 1149 Generally, the default value should suffice. Only set this setting if you want 1148 1150 to restrict language selection to a subset of the Django-provided languages. 1149 1151 1150 If you define a custom ``LANGUAGES`` setting, it's OK to mark the languages as1152 If you define a custom :setting:`LANGUAGES` setting, it's OK to mark the languages as 1151 1153 translation strings (as in the default value referred to above) -- but use a 1152 1154 "dummy" ``gettext()`` function, not the one in ``django.utils.translation``. 1153 1155 You should *never* import ``django.utils.translation`` from within your … … 1167 1169 With this arrangement, ``django-admin.py makemessages`` will still find and 1168 1170 mark these strings for translation, but the translation won't happen at 1169 1171 runtime -- so you'll have to remember to wrap the languages in the *real* 1170 ``gettext()`` in any code that uses ``LANGUAGES`` at runtime.1172 ``gettext()`` in any code that uses :setting:`LANGUAGES` at runtime. 1171 1173 1172 1174 .. setting:: LOCALE_PATHS 1173 1175 … … 1263 1265 1264 1266 Default: ``()`` (Empty tuple) 1265 1267 1266 A tuple in the same format as ``ADMINS`` that specifies who should get1268 A tuple in the same format as :setting:`ADMINS` that specifies who should get 1267 1269 broken-link notifications when ``SEND_BROKEN_LINK_EMAILS=True``. 1268 1270 1269 1271 .. setting:: MEDIA_ROOT … … 1368 1370 locales have different formats. For example, U.S. English would say 1369 1371 "January 1," whereas Spanish might say "1 Enero." 1370 1372 1371 See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``, 1372 ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``YEAR_MONTH_FORMAT``. 1373 See :tfilter:`allowed date format strings <date>`. See also 1374 :setting:`DATE_FORMAT`, :setting:`DATETIME_FORMAT`, 1375 :setting:`TIME_FORMAT` and :setting:`YEAR_MONTH_FORMAT`. 1373 1376 1374 1377 .. setting:: NUMBER_GROUPING 1375 1378 … … 1463 1466 1464 1467 Default: ``False`` 1465 1468 1466 Whether to send an email to the ``MANAGERS`` each time somebody visits a1469 Whether to send an email to the :setting:`MANAGERS` each time somebody visits a 1467 1470 Django-powered page that is 404ed with a non-empty referer (i.e., a broken 1468 1471 link). This is only used if ``CommonMiddleware`` is installed (see 1469 :doc:`/topics/http/middleware`). See also ``IGNORABLE_404_URLS`` and1472 :doc:`/topics/http/middleware`). See also :setting:`IGNORABLE_404_URLS` and 1470 1473 :doc:`/howto/error-reporting`. 1471 1474 1472 1475 .. setting:: SERIALIZATION_MODULES … … 1490 1493 Default: ``'root@localhost'`` 1491 1494 1492 1495 The email address that error messages come from, such as those sent to 1493 ``ADMINS`` and ``MANAGERS``.1496 :setting:`ADMINS` and :setting:`MANAGERS`. 1494 1497 1495 1498 .. setting:: SESSION_COOKIE_AGE 1496 1499 … … 1539 1542 Default: ``'sessionid'`` 1540 1543 1541 1544 The name of the cookie to use for sessions. This can be whatever you want (but 1542 should be different from ``LANGUAGE_COOKIE_NAME``). See the :doc:`/topics/http/sessions`. 1545 should be different from :setting:`LANGUAGE_COOKIE_NAME`). 1546 See the :doc:`/topics/http/sessions`. 1543 1547 1544 1548 .. setting:: SESSION_COOKIE_PATH 1545 1549 … … 1629 1633 corresponding locale-dictated format has higher precedence and will be applied. 1630 1634 See :tfilter:`allowed date format strings <date>`. 1631 1635 1632 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.1636 See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`. 1633 1637 1634 1638 .. setting:: SHORT_DATETIME_FORMAT 1635 1639 … … 1645 1649 corresponding locale-dictated format has higher precedence and will be applied. 1646 1650 See :tfilter:`allowed date format strings <date>`. 1647 1651 1648 See also ``DATE_FORMAT`` and ``SHORT_DATETIME_FORMAT``.1652 See also :setting:`DATE_FORMAT` and :setting:`SHORT_DATETIME_FORMAT`. 1649 1653 1650 1654 .. setting:: SIGNING_BACKEND 1651 1655 … … 1767 1771 report contains the relevant snippet of the template, with the appropriate line 1768 1772 highlighted. 1769 1773 1770 Note that Django only displays fancy error pages if ``DEBUG`` is ``True``, so1774 Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so 1771 1775 you'll want to set that to take advantage of this setting. 1772 1776 1773 See also ``DEBUG``.1777 See also :setting:`DEBUG`. 1774 1778 1775 1779 .. setting:: TEMPLATE_DIRS 1776 1780 … … 1802 1806 1803 1807 .. versionchanged:: 1.2 1804 1808 The class-based API for template loaders was introduced in Django 1.2 1805 although the ``TEMPLATE_LOADERS`` setting will accept strings that specify1809 although the :setting:`TEMPLATE_LOADERS` setting will accept strings that specify 1806 1810 function-based loaders until compatibility with them is completely removed in 1807 1811 Django 1.4. 1808 1812 … … 1838 1842 1839 1843 .. versionadded:: 1.2 1840 1844 1841 Default ``,`` (Comma)1845 Default: ``,`` (Comma) 1842 1846 1843 1847 Default thousand separator used when formatting numbers. This setting is 1844 used only when ``NUMBER_GROUPING`` and ``USE_THOUSAND_SEPARATOR`` are set.1848 used only when :setting:`NUMBER_GROUPING` and :setting:`USE_THOUSAND_SEPARATOR` are set. 1845 1849 1846 1850 See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and 1847 1851 :setting:`USE_THOUSAND_SEPARATOR`. … … 1859 1863 :tfilter:`allowed date format strings <date>`. 1860 1864 1861 1865 .. versionchanged:: 1.2 1862 This setting can now be overriden by setting ``USE_L10N`` to ``True``.1866 This setting can now be overriden by setting :setting:`USE_L10N` to ``True``. 1863 1867 1864 See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.1868 See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`. 1865 1869 1866 1870 .. setting:: TIME_INPUT_FORMATS 1867 1871 … … 1878 1882 syntax, that is different from the one used by Django for formatting dates 1879 1883 to be displayed. 1880 1884 1881 See also ``DATE_INPUT_FORMATS`` and ``DATETIME_INPUT_FORMATS``.1885 See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`. 1882 1886 1883 1887 .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior 1884 1888 … … 1897 1901 choices lists more than one on the same line; you'll want to use just 1898 1902 one of the choices for a given time zone. For instance, one line says 1899 1903 ``'Europe/London GB GB-Eire'``, but you should use the first bit of 1900 that -- ``'Europe/London'`` -- as your ``TIME_ZONE`` setting.)1904 that -- ``'Europe/London'`` -- as your :setting:`TIME_ZONE` setting.) 1901 1905 1902 1906 Note that this is the time zone to which Django will convert all 1903 1907 dates/times -- not necessarily the timezone of the server. For … … 1905 1909 a separate time-zone setting. 1906 1910 1907 1911 Normally, Django sets the ``os.environ['TZ']`` variable to the time 1908 zone you specify in the ``TIME_ZONE`` setting. Thus, all your views1912 zone you specify in the :setting:`TIME_ZONE` setting. Thus, all your views 1909 1913 and models will automatically operate in the correct time zone. 1910 1914 However, Django won't set the ``TZ`` environment variable under the 1911 1915 following conditions: … … 1962 1966 set to ``False``, Django will make some optimizations so as not to load the 1963 1967 internationalization machinery. 1964 1968 1965 See also ``USE_L10N``1969 See also :setting:`USE_L10N` 1966 1970 1967 1971 .. setting:: USE_L10N 1968 1972 … … 1971 1975 1972 1976 .. versionadded:: 1.2 1973 1977 1974 Default ``False``1978 Default: ``False`` 1975 1979 1976 1980 A boolean that specifies if data will be localized by default or not. If this 1977 1981 is set to ``True``, e.g. Django will display numbers and dates using the 1978 1982 format of the current locale. 1979 1983 1980 See also ``USE_I18N`` and ``LANGUAGE_CODE``1984 See also :setting:`USE_I18N` and :setting:`LANGUAGE_CODE` 1981 1985 1982 1986 .. setting:: USE_THOUSAND_SEPARATOR 1983 1987 … … 1986 1990 1987 1991 .. versionadded:: 1.2 1988 1992 1989 Default ``False``1993 Default: ``False`` 1990 1994 1991 1995 A boolean that specifies wheter to display numbers using a thousand separator. 1992 If this is set to ``True``, Django will use values from ``THOUSAND_SEPARATOR``1993 and ``NUMBER_GROUPING`` from current locale, to format the number.1994 ``USE_L10N`` must be set to ``True``, in order to format numbers.1996 If this is set to ``True``, Django will use values from :setting:`THOUSAND_SEPARATOR` 1997 and :setting:`NUMBER_GROUPING` from current locale, to format the number. 1998 :setting:`USE_L10N` must be set to ``True``, in order to format numbers. 1995 1999 1996 See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.2000 See also :setting:`THOUSAND_SEPARATOR` and :setting:`NUMBER_GROUPING`. 1997 2001 1998 2002 .. setting:: YEAR_MONTH_FORMAT 1999 2003 … … 2011 2015 Different locales have different formats. For example, U.S. English would say 2012 2016 "January 2006," whereas another locale might say "2006/January." 2013 2017 2014 See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,2015 ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``MONTH_DAY_FORMAT``.2018 See :tfilter:`allowed date format strings <date>`. See also :setting:`DATE_FORMAT`, 2019 :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`MONTH_DAY_FORMAT`. 2016 2020 2017 2021 Deprecated settings 2018 2022 =================== -
docs/ref/utils.txt
61 61 62 62 Each header is only added if it isn't already set. 63 63 64 ``cache_timeout`` is in seconds. The ``CACHE_MIDDLEWARE_SECONDS`` setting64 ``cache_timeout`` is in seconds. The :setting:`CACHE_MIDDLEWARE_SECONDS` setting 65 65 is used by default. 66 66 67 67 .. function:: add_never_cache_headers(response)