mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #15992 -- Added more references to settings. Thanks, aaugustin.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@16290 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -225,8 +225,8 @@ Upload Handlers
|
||||
|
||||
When a user uploads a file, Django passes off the file data to an *upload
|
||||
handler* -- a small class that handles file data as it gets uploaded. Upload
|
||||
handlers are initially defined in the ``FILE_UPLOAD_HANDLERS`` setting, which
|
||||
defaults to::
|
||||
handlers are initially defined in the :setting:`FILE_UPLOAD_HANDLERS` setting,
|
||||
which defaults to::
|
||||
|
||||
("django.core.files.uploadhandler.MemoryFileUploadHandler",
|
||||
"django.core.files.uploadhandler.TemporaryFileUploadHandler",)
|
||||
@@ -246,8 +246,8 @@ Modifying upload handlers on the fly
|
||||
Sometimes particular views require different upload behavior. In these cases,
|
||||
you can override upload handlers on a per-request basis by modifying
|
||||
``request.upload_handlers``. By default, this list will contain the upload
|
||||
handlers given by ``FILE_UPLOAD_HANDLERS``, but you can modify the list as you
|
||||
would any other list.
|
||||
handlers given by :setting:`FILE_UPLOAD_HANDLERS`, but you can modify the list
|
||||
as you would any other list.
|
||||
|
||||
For instance, suppose you've written a ``ProgressBarUploadHandler`` that
|
||||
provides feedback on upload progress to some sort of AJAX widget. You'd add this
|
||||
|
||||
@@ -23,7 +23,7 @@ To enable session functionality, do the following:
|
||||
has ``SessionMiddleware`` activated.
|
||||
|
||||
If you don't want to use sessions, you might as well remove the
|
||||
``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES`` and
|
||||
``SessionMiddleware`` line from :setting:`MIDDLEWARE_CLASSES` and
|
||||
``'django.contrib.sessions'`` from your :setting:`INSTALLED_APPS`.
|
||||
It'll save you a small bit of overhead.
|
||||
|
||||
@@ -39,7 +39,7 @@ Using database-backed sessions
|
||||
------------------------------
|
||||
|
||||
If you want to use a database-backed session, you need to add
|
||||
``'django.contrib.sessions'`` to your ``INSTALLED_APPS`` setting.
|
||||
``'django.contrib.sessions'`` to your :setting:`INSTALLED_APPS` setting.
|
||||
|
||||
Once you have configured your installation, run ``manage.py syncdb``
|
||||
to install the single database table that stores session data.
|
||||
@@ -359,8 +359,8 @@ setting to ``True``. When set to ``True``, Django will save the session to the
|
||||
database on every single request.
|
||||
|
||||
Note that the session cookie is only sent when a session has been created or
|
||||
modified. If ``SESSION_SAVE_EVERY_REQUEST`` is ``True``, the session cookie
|
||||
will be sent on every request.
|
||||
modified. If :setting:`SESSION_SAVE_EVERY_REQUEST` is ``True``, the session
|
||||
cookie will be sent on every request.
|
||||
|
||||
Similarly, the ``expires`` part of a session cookie is updated each time the
|
||||
session cookie is sent.
|
||||
@@ -372,15 +372,15 @@ You can control whether the session framework uses browser-length sessions vs.
|
||||
persistent sessions with the :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE`
|
||||
setting.
|
||||
|
||||
By default, ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``False``, which
|
||||
means session cookies will be stored in users' browsers for as long as
|
||||
By default, :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``False``,
|
||||
which means session cookies will be stored in users' browsers for as long as
|
||||
:setting:`SESSION_COOKIE_AGE`. Use this if you don't want people to have to
|
||||
log in every time they open a browser.
|
||||
|
||||
If ``SESSION_EXPIRE_AT_BROWSER_CLOSE`` is set to ``True``, Django will use
|
||||
browser-length cookies -- cookies that expire as soon as the user closes his or
|
||||
her browser. Use this if you want people to have to log in every time they open
|
||||
a browser.
|
||||
If :setting:`SESSION_EXPIRE_AT_BROWSER_CLOSE` is set to ``True``, Django will
|
||||
use browser-length cookies -- cookies that expire as soon as the user closes
|
||||
his or her browser. Use this if you want people to have to log in every time
|
||||
they open a browser.
|
||||
|
||||
This setting is a global default and can be overwritten at a per-session level
|
||||
by explicitly calling the :meth:`~backends.base.SessionBase.set_expiry` method
|
||||
|
||||
@@ -48,7 +48,7 @@ Let's step through this code one line at a time:
|
||||
|
||||
.. admonition:: Django's Time Zone
|
||||
|
||||
Django includes a ``TIME_ZONE`` setting that defaults to
|
||||
Django includes a :setting:`TIME_ZONE` setting that defaults to
|
||||
``America/Chicago``. This probably isn't where you live, so you might want
|
||||
to change it in your settings file.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user