Ticket #15992: 15992.2.patch
File 15992.2.patch, 56.7 KB (added by , 14 years ago) |
---|
-
docs/internals/contributing.txt
1004 1004 1005 1005 You will also need to ensure that your database uses UTF-8 as the default 1006 1006 character set. If your database server doesn't use UTF-8 as a default charset, 1007 you will need to include a value for ``TEST_CHARSET`` in the settings1007 you will need to include a value for :setting:`TEST_CHARSET` in the settings 1008 1008 dictionary for the applicable database. 1009 1009 1010 1010 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/i18n/internationalization.txt
675 675 ) 676 676 677 677 Each string in ``packages`` should be in Python dotted-package syntax (the 678 same format as the strings in ``INSTALLED_APPS``) and should refer to a package678 same format as the strings in :setting:`INSTALLED_APPS`) and should refer to a package 679 679 that contains a ``locale`` directory. If you specify multiple packages, all 680 680 those catalogs are merged into one catalog. This is useful if you have 681 681 JavaScript that uses strings from different applications. … … 708 708 later. 709 709 710 710 .. versionchanged:: 1.3 711 Directories listed in ``LOCALE_PATHS`` weren't included in the lookup711 Directories listed in :setting:`LOCALE_PATHS` weren't included in the lookup 712 712 algorithm until version 1.3. 713 713 714 714 Using the JavaScript translation catalog -
docs/topics/i18n/index.txt
104 104 variant on the provided English value. The format is identical to the format 105 105 strings used by the ``now`` template tag. 106 106 107 For example, with ``DATETIME_FORMAT`` (or ``DATE_FORMAT`` or ``TIME_FORMAT``),107 For example, with :setting:`DATETIME_FORMAT` (or :setting:`DATE_FORMAT` or :setting:`TIME_FORMAT`), 108 108 this would be the format string that you want to use in your language. A Django 109 109 contributor localizing it to Spanish probably would provide a ``"j N Y P"`` 110 110 "translation" for it in the relevant ``django.po`` file:: -
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/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
17 17 18 18 To enable session functionality, do the following: 19 19 20 * Edit the ``MIDDLEWARE_CLASSES`` setting and make sure21 ``MIDDLEWARE_CLASSES`` contains ``'django.contrib.sessions.middleware.SessionMiddleware'``.20 * Edit the :setting:`MIDDLEWARE_CLASSES` setting and make sure 21 :setting:`MIDDLEWARE_CLASSES` contains ``'django.contrib.sessions.middleware.SessionMiddleware'``. 22 22 The default ``settings.py`` created by ``django-admin.py startproject`` has 23 23 ``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`` and ``'django.contrib.sessions'``27 from your ``INSTALLED_APPS``. It'll save you a small bit of overhead.26 ``SessionMiddleware`` line from :setting:`MIDDLEWARE_CLASSES` and ``'django.contrib.sessions'`` 27 from your :setting:`INSTALLED_APPS`. It'll save you a small bit of overhead. 28 28 29 29 Configuring the session engine 30 30 ============================== … … 38 38 ------------------------------ 39 39 40 40 If you want to use a database-backed session, you need to add 41 ``'django.contrib.sessions'`` to your ``INSTALLED_APPS`` setting.41 ``'django.contrib.sessions'`` to your :setting:`INSTALLED_APPS` setting. 42 42 43 43 Once you have configured your installation, run ``manage.py syncdb`` 44 44 to install the single database table that stores session data. … … 86 86 Using file-based sessions 87 87 ------------------------- 88 88 89 To use file-based sessions, set the ``SESSION_ENGINE`` setting to89 To use file-based sessions, set the :setting:`SESSION_ENGINE` setting to 90 90 ``"django.contrib.sessions.backends.file"``. 91 91 92 You might also want to set the ``SESSION_FILE_PATH`` setting (which defaults92 You might also want to set the :setting:`SESSION_FILE_PATH` setting (which defaults 93 93 to output from ``tempfile.gettempdir()``, most likely ``/tmp``) to control 94 94 where Django stores session files. Be sure to check that your Web server has 95 95 permissions to read and write to this location. … … 346 346 347 347 request.session.modified = True 348 348 349 To change this default behavior, set the ``SESSION_SAVE_EVERY_REQUEST`` setting350 to ``True``. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, Django will save349 To change this default behavior, set the :setting:`SESSION_SAVE_EVERY_REQUEST` setting 350 to ``True``. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, Django will save 351 351 the session to the database on every single request. 352 352 353 353 Note that the session cookie is only sent when a session has been created or 354 modified. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, the session cookie354 modified. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, the session cookie 355 355 will be sent on every request. 356 356 357 357 Similarly, the ``expires`` part of a session cookie is updated each time the … … 361 361 =============================================== 362 362 363 363 You can control whether the session framework uses browser-length sessions vs. 364 persistent sessions with the ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` setting.364 persistent sessions with the :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` setting. 365 365 366 By default, ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``False``, which366 By default, :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``False``, which 367 367 means session cookies will be stored in users' browsers for as long as 368 ``SESSION_COOKIE_AGE``. Use this if you don't want people to have to log in368 :setting:`SESSION_COOKIE_AGE`. Use this if you don't want people to have to log in 369 369 every time they open a browser. 370 370 371 If ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``True``, Django will use371 If :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``True``, Django will use 372 372 browser-length cookies -- cookies that expire as soon as the user closes his or 373 373 her browser. Use this if you want people to have to log in every time they open 374 374 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/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
382 382 Aside from using a separate database, the test runner will otherwise 383 383 use all of the same database settings you have in your settings file: 384 384 :setting:`ENGINE`, :setting:`USER`, :setting:`HOST`, etc. The test 385 database is created by the user specified by ``USER``, so you'll need385 database is created by the user specified by :setting:`USER`, so you'll need 386 386 to make sure that the given user account has sufficient privileges to 387 387 create a new database on the system. 388 388 … … 1299 1299 ``django.test.TestCase`` provides the ability to customize the URLconf 1300 1300 configuration for the duration of the execution of a test suite. If your 1301 1301 ``TestCase`` instance defines an ``urls`` attribute, the ``TestCase`` will use 1302 the value of that attribute as the ``ROOT_URLCONF`` for the duration of that1302 the value of that attribute as the :setting:`ROOT_URLCONF` for the duration of that 1303 1303 test. 1304 1304 1305 1305 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
1305 1305 ``datetime.datetime.now()``), the output will be the string 1306 1306 ``'Wed 09 Jan 2008'``. 1307 1307 1308 The format passed can be one of the predefined ones ``DATE_FORMAT``,1309 ``DATETIME_FORMAT``, ``SHORT_DATE_FORMAT`` or ``SHORT_DATETIME_FORMAT``, or a1308 The format passed can be one of the predefined ones :setting:`DATE_FORMAT`, 1309 :setting:`DATETIME_FORMAT`, :setting:`SHORT_DATE_FORMAT` or :setting:`SHORT_DATETIME_FORMAT`, or a 1310 1310 custom format that uses the format specifiers shown in the table above. Note 1311 1311 that predefined formats may vary depending on the current locale. 1312 1312 … … 1939 1939 1940 1940 Formats a time according to the given format. 1941 1941 1942 Given format can be the predefined one ``TIME_FORMAT``, or a custom format,1942 Given format can be the predefined one :setting:`TIME_FORMAT`, or a custom format, 1943 1943 same as the :tfilter:`date` filter. Note that the predefined format is locale- 1944 1944 dependant. 1945 1945 … … 2241 2241 ------------------------------- 2242 2242 2243 2243 Django comes with a couple of other template-tag libraries that you have to 2244 enable explicitly in your ``INSTALLED_APPS`` setting and enable in your2244 enable explicitly in your :setting:`INSTALLED_APPS` setting and enable in your 2245 2245 template with the ``{% load %}`` tag. 2246 2246 2247 2247 django.contrib.humanize … … 2272 2272 2273 2273 Provides a couple of templatetags that allow specifying translatable text in 2274 2274 Django templates. It is slightly different from the libraries described 2275 above because you don't need to add any application to the ``INSTALLED_APPS``2275 above because you don't need to add any application to the :setting:`INSTALLED_APPS` 2276 2276 setting but rather set :setting:`USE_I18N` to True, then loading it with 2277 2277 ``{% load i18n %}``. See :ref:`specifying-translation-strings-in-template-code`. 2278 2278 … … 2281 2281 2282 2282 Provides a couple of templatetags that allow control over the localization of 2283 2283 values in Django templates. It is slightly different from the libraries described 2284 above because you don't need to add any application to the ``INSTALLED_APPS``;2284 above because you don't need to add any application to the :setting:`INSTALLED_APPS`; 2285 2285 you only need to load the library using ``{% load l10n %}``. See 2286 2286 :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
180 180 181 181 .. _geoslibrarypath: 182 182 183 ``GEOS_LIBRARY_PATH``184 ~~~~~~~~~~~~~~~~~~~~~ 183 :setting:`GEOS_LIBRARY_PATH` 184 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 185 185 186 186 If your GEOS library is in a non-standard location, or you don't want to 187 187 modify the system's library path then the :setting:`GEOS_LIBRARY_PATH` setting … … 318 318 319 319 .. _gdallibrarypath: 320 320 321 ``GDAL_LIBRARY_PATH``322 ~~~~~~~~~~~~~~~~~~~~~ 321 :setting:`GDAL_LIBRARY_PATH` 322 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 323 323 324 324 If your GDAL library is in a non-standard location, or you don't want to 325 325 modify the system's library path then the :setting:`GDAL_LIBRARY_PATH` … … 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/gis/testing.txt
25 25 26 26 .. setting:: POSTGIS_TEMPLATE 27 27 28 ``POSTGIS_TEMPLATE``29 ^^^^^^^^^^^^^^^^^^^^ 28 :setting:`POSTGIS_TEMPLATE` 29 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 30 30 31 31 .. versionchanged:: 1.2 32 32 … … 37 37 38 38 .. setting:: POSTGIS_VERSION 39 39 40 ``POSTGIS_VERSION``41 ^^^^^^^^^^^^^^^^^^^ 40 :setting:`POSTGIS_VERSION` 41 ^^^^^^^^^^^^^^^^^^^^^^^^^^ 42 42 43 43 When GeoDjango's spatial backend initializes on PostGIS, it has to perform 44 44 a SQL query to determine the version in order to figure out what … … 129 129 130 130 .. setting:: SPATIALITE_SQL 131 131 132 ``SPATIALITE_SQL``133 ^^^^^^^^^^^^^^^^^^ 132 :setting:`SPATIALITE_SQL` 133 ^^^^^^^^^^^^^^^^^^^^^^^^^ 134 134 135 135 By default, the GeoDjango test runner looks for the SpatiaLite SQL in the 136 136 same directory where it was invoked (by default the same directory where -
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
1745 1745 ) 1746 1746 1747 1747 Above we used ``admin.autodiscover()`` to automatically load the 1748 ``INSTALLED_APPS`` admin.py modules.1748 :setting:`INSTALLED_APPS` admin.py modules. 1749 1749 1750 1750 In this example, we register the ``AdminSite`` instance 1751 1751 ``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:: SITE_ID 1651 1655 … … 1754 1758 report contains the relevant snippet of the template, with the appropriate line 1755 1759 highlighted. 1756 1760 1757 Note that Django only displays fancy error pages if ``DEBUG`` is ``True``, so1761 Note that Django only displays fancy error pages if :setting:`DEBUG` is ``True``, so 1758 1762 you'll want to set that to take advantage of this setting. 1759 1763 1760 See also ``DEBUG``.1764 See also :setting:`DEBUG`. 1761 1765 1762 1766 .. setting:: TEMPLATE_DIRS 1763 1767 … … 1789 1793 1790 1794 .. versionchanged:: 1.2 1791 1795 The class-based API for template loaders was introduced in Django 1.2 1792 although the ``TEMPLATE_LOADERS`` setting will accept strings that specify1796 although the :setting:`TEMPLATE_LOADERS` setting will accept strings that specify 1793 1797 function-based loaders until compatibility with them is completely removed in 1794 1798 Django 1.4. 1795 1799 … … 1825 1829 1826 1830 .. versionadded:: 1.2 1827 1831 1828 Default ``,`` (Comma)1832 Default: ``,`` (Comma) 1829 1833 1830 1834 Default thousand separator used when formatting numbers. This setting is 1831 used only when ``NUMBER_GROUPING`` and ``USE_THOUSAND_SEPARATOR`` are set.1835 used only when :setting:`NUMBER_GROUPING` and :setting:`USE_THOUSAND_SEPARATOR` are set. 1832 1836 1833 1837 See also :setting:`NUMBER_GROUPING`, :setting:`DECIMAL_SEPARATOR` and 1834 1838 :setting:`USE_THOUSAND_SEPARATOR`. … … 1846 1850 :tfilter:`allowed date format strings <date>`. 1847 1851 1848 1852 .. versionchanged:: 1.2 1849 This setting can now be overriden by setting ``USE_L10N`` to ``True``.1853 This setting can now be overriden by setting :setting:`USE_L10N` to ``True``. 1850 1854 1851 See also ``DATE_FORMAT`` and ``DATETIME_FORMAT``.1855 See also :setting:`DATE_FORMAT` and :setting:`DATETIME_FORMAT`. 1852 1856 1853 1857 .. setting:: TIME_INPUT_FORMATS 1854 1858 … … 1865 1869 syntax, that is different from the one used by Django for formatting dates 1866 1870 to be displayed. 1867 1871 1868 See also ``DATE_INPUT_FORMATS`` and ``DATETIME_INPUT_FORMATS``.1872 See also :setting:`DATE_INPUT_FORMATS` and :setting:`DATETIME_INPUT_FORMATS`. 1869 1873 1870 1874 .. _datetime: http://docs.python.org/library/datetime.html#strftime-strptime-behavior 1871 1875 … … 1884 1888 choices lists more than one on the same line; you'll want to use just 1885 1889 one of the choices for a given time zone. For instance, one line says 1886 1890 ``'Europe/London GB GB-Eire'``, but you should use the first bit of 1887 that -- ``'Europe/London'`` -- as your ``TIME_ZONE`` setting.)1891 that -- ``'Europe/London'`` -- as your :setting:`TIME_ZONE` setting.) 1888 1892 1889 1893 Note that this is the time zone to which Django will convert all 1890 1894 dates/times -- not necessarily the timezone of the server. For … … 1892 1896 a separate time-zone setting. 1893 1897 1894 1898 Normally, Django sets the ``os.environ['TZ']`` variable to the time 1895 zone you specify in the ``TIME_ZONE`` setting. Thus, all your views1899 zone you specify in the :setting:`TIME_ZONE` setting. Thus, all your views 1896 1900 and models will automatically operate in the correct time zone. 1897 1901 However, Django won't set the ``TZ`` environment variable under the 1898 1902 following conditions: … … 1949 1953 set to ``False``, Django will make some optimizations so as not to load the 1950 1954 internationalization machinery. 1951 1955 1952 See also ``USE_L10N``1956 See also :setting:`USE_L10N` 1953 1957 1954 1958 .. setting:: USE_L10N 1955 1959 … … 1958 1962 1959 1963 .. versionadded:: 1.2 1960 1964 1961 Default ``False``1965 Default: ``False`` 1962 1966 1963 1967 A boolean that specifies if data will be localized by default or not. If this 1964 1968 is set to ``True``, e.g. Django will display numbers and dates using the 1965 1969 format of the current locale. 1966 1970 1967 See also ``USE_I18N`` and ``LANGUAGE_CODE``1971 See also :setting:`USE_I18N` and :setting:`LANGUAGE_CODE` 1968 1972 1969 1973 .. setting:: USE_THOUSAND_SEPARATOR 1970 1974 … … 1973 1977 1974 1978 .. versionadded:: 1.2 1975 1979 1976 Default ``False``1980 Default: ``False`` 1977 1981 1978 1982 A boolean that specifies wheter to display numbers using a thousand separator. 1979 If this is set to ``True``, Django will use values from ``THOUSAND_SEPARATOR``1980 and ``NUMBER_GROUPING`` from current locale, to format the number.1981 ``USE_L10N`` must be set to ``True``, in order to format numbers.1983 If this is set to ``True``, Django will use values from :setting:`THOUSAND_SEPARATOR` 1984 and :setting:`NUMBER_GROUPING` from current locale, to format the number. 1985 :setting:`USE_L10N` must be set to ``True``, in order to format numbers. 1982 1986 1983 See also ``THOUSAND_SEPARATOR`` and ``NUMBER_GROUPING``.1987 See also :setting:`THOUSAND_SEPARATOR` and :setting:`NUMBER_GROUPING`. 1984 1988 1985 1989 .. setting:: YEAR_MONTH_FORMAT 1986 1990 … … 1998 2002 Different locales have different formats. For example, U.S. English would say 1999 2003 "January 2006," whereas another locale might say "2006/January." 2000 2004 2001 See :tfilter:`allowed date format strings <date>`. See also ``DATE_FORMAT``,2002 ``DATETIME_FORMAT``, ``TIME_FORMAT`` and ``MONTH_DAY_FORMAT``.2005 See :tfilter:`allowed date format strings <date>`. See also :setting:`DATE_FORMAT`, 2006 :setting:`DATETIME_FORMAT`, :setting:`TIME_FORMAT` and :setting:`MONTH_DAY_FORMAT`. 2003 2007 2004 2008 Deprecated settings 2005 2009 =================== -
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)