diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/apache_auth.txt | 9 | ||||
| -rw-r--r-- | docs/generic_views.txt | 47 | ||||
| -rw-r--r-- | docs/model-api.txt | 12 | ||||
| -rw-r--r-- | docs/sessions.txt | 24 | ||||
| -rw-r--r-- | docs/settings.txt | 8 | ||||
| -rw-r--r-- | docs/tutorial02.txt | 2 | ||||
| -rw-r--r-- | docs/tutorial03.txt | 6 |
7 files changed, 102 insertions, 6 deletions
diff --git a/docs/apache_auth.txt b/docs/apache_auth.txt index 0dd5d00cbe..72e0841305 100644 --- a/docs/apache_auth.txt +++ b/docs/apache_auth.txt @@ -56,6 +56,15 @@ location to users marked as staff members. You can use a set of required. ================================ ========================================= +Note that sometimes ``SetEnv`` doesn't play well in this mod_python +configuration, for reasons unknown. If you're having problems getting +mod_python to recognize your ``DJANGO_SETTINGS_MODULE``, you can set it using +``PythonOption`` instead of ``SetEnv``. Therefore, these two Apache directives +are equivalent:: + + SetEnv DJANGO_SETTINGS_MODULE mysite.settings + PythonOption DJANGO_SETTINGS_MODULE mysite.settings + .. _authentication system: http://www.djangoproject.com/documentation/authentication/ .. _Subversion: http://subversion.tigris.org/ .. _mod_dav: http://httpd.apache.org/docs/2.0/mod/mod_dav.html diff --git a/docs/generic_views.txt b/docs/generic_views.txt index 5b978af1de..317828a2b2 100644 --- a/docs/generic_views.txt +++ b/docs/generic_views.txt @@ -182,6 +182,9 @@ a date in the *future* are not included. * ``context_processors``: A list of template-context processors to apply to the view's template. See the `RequestContext docs`_. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -247,6 +250,21 @@ with a date in the *future* are not displayed. * ``context_processors``: A list of template-context processors to apply to the view's template. See the `RequestContext docs`_. + * ``template_object_name``: Designates the name of the template variable + to use in the template context. By default, this is ``'object'``. The + view will append ``'_list'`` to the value of this parameter in + determining the variable's name. + + * ``make_object_list``: A boolean specifying whether to retrieve the full + list of objects for this year and pass those to the template. If ``True``, + this list of objects will be made available to the template as + ``object_list``. (The name ``object_list`` may be different; see the docs + for ``object_list`` in the "Template context" section below.) By default, + this is ``False``. + + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -259,8 +277,19 @@ In addition to ``extra_context``, the template's context will be: * ``date_list``: A list of ``datetime.date`` objects representing all months that have objects available in the given year, according to ``queryset``, in ascending order. + * ``year``: The given year, as a four-character string. + * ``object_list``: If the ``make_object_list`` parameter is ``True``, this + will be set to a list of objects available for the given year, ordered by + the date field. This variable's name depends on the + ``template_object_name`` parameter, which is ``'object'`` by default. If + ``template_object_name`` is ``'foo'``, this variable's name will be + ``foo_list``. + + If ``make_object_list`` is ``False``, ``object_list`` will be passed to + the template as an empty list. + ``django.views.generic.date_based.archive_month`` ------------------------------------------------- @@ -314,6 +343,9 @@ date in the *future* are not displayed. view will append ``'_list'`` to the value of this parameter in determining the variable's name. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -387,6 +419,9 @@ in the *future* are not displayed. view will append ``'_list'`` to the value of this parameter in determining the variable's name. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -463,6 +498,9 @@ a 404 error, regardless of whether any objects exist for future days. view will append ``'_list'`` to the value of this parameter in determining the variable's name. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -563,6 +601,9 @@ A page representing an individual object. * ``template_object_name``: Designates the name of the template variable to use in the template context. By default, this is ``'object'``. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -627,6 +668,9 @@ A page representing a list of objects. view will append ``'_list'`` to the value of this parameter in determining the variable's name. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template @@ -717,6 +761,9 @@ A page representing an individual object. * ``template_object_name``: Designates the name of the template variable to use in the template context. By default, this is ``'object'``. + * ``mimetype``: The MIME type to use for the resulting document. Defaults + to the value of the ``DEFAULT_MIME_TYPE`` setting. + **Template name:** If ``template_name`` isn't specified, this view will use the template diff --git a/docs/model-api.txt b/docs/model-api.txt index 3e40a6f63f..9cc5b8f203 100644 --- a/docs/model-api.txt +++ b/docs/model-api.txt @@ -162,11 +162,15 @@ A date field. Has a few extra optional arguments: ====================== =================================================== ``auto_now`` Automatically set the field to now every time the object is saved. Useful for "last-modified" - timestamps. + timestamps. Note that the current date is *always* + used; it's not just a default value that you can + override. ``auto_now_add`` Automatically set the field to now when the object is first created. Useful for creation of - timestamps. + timestamps. Note that the current date is *always* + used; it's not just a default value that you can + override. ====================== =================================================== The admin represents this as an ``<input type="text">`` with a JavaScript @@ -488,6 +492,10 @@ cleared, the object will be deleted. It is an error to have an inline-editable relation without at least one ``core=True`` field. +Please note that each field marked "core" is treated as a required field by the +Django admin site. Essentially, this means you should put ``core=True`` on all +required fields in your related object that is being edited inline. + ``db_column`` ~~~~~~~~~~~~~ diff --git a/docs/sessions.txt b/docs/sessions.txt index b7f16b67b9..2dba491159 100644 --- a/docs/sessions.txt +++ b/docs/sessions.txt @@ -197,6 +197,22 @@ will be sent on every request. Similarly, the ``expires`` part of a session cookie is updated each time the session cookie is sent. +Browser-length sessions vs. persistent sessions +=============================================== + +You can control whether the session framework uses browser-length sessions vs. +persistent sessions with the ``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 +``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. + Settings ======== @@ -225,6 +241,14 @@ Default: ``'sessionid'`` The name of the cookie to use for sessions. This can be whatever you want. +SESSION_EXPIRE_AT_BROWSER_CLOSE +------------------------------- + +Default: ``False`` + +Whether to expire the session when the user closes his or her browser. See +"Browser-length sessions vs. persistent sessions" above. + SESSION_SAVE_EVERY_REQUEST -------------------------- diff --git a/docs/settings.txt b/docs/settings.txt index 80000fad5b..26d5930f21 100644 --- a/docs/settings.txt +++ b/docs/settings.txt @@ -603,6 +603,14 @@ Default: ``'sessionid'`` The name of the cookie to use for sessions. This can be whatever you want. See the `session docs`_. +SESSION_EXPIRE_AT_BROWSER_CLOSE +------------------------------- + +Default: ``False`` + +Whether to expire the session when the user closes his or her browser. +See the `session docs`_. + SESSION_SAVE_EVERY_REQUEST -------------------------- diff --git a/docs/tutorial02.txt b/docs/tutorial02.txt index 4cc263dddc..84eae3eb83 100644 --- a/docs/tutorial02.txt +++ b/docs/tutorial02.txt @@ -85,7 +85,7 @@ creating an empty class means "give this object an admin interface using all the default options." Now reload the Django admin page to see your changes. Note that you don't have -to restart the development server -- the server will auto-reloads your project, +to restart the development server -- the server will auto-reload your project, so any modifications code will be seen immediately in your browser. Explore the free admin functionality diff --git a/docs/tutorial03.txt b/docs/tutorial03.txt index f368d54c53..3a830eb76f 100644 --- a/docs/tutorial03.txt +++ b/docs/tutorial03.txt @@ -209,13 +209,13 @@ So let's use Django's template system to separate the design from Python:: }) return HttpResponse(t.render(c)) -That code loads the template called "polls/index" and passes it a context. The +That code loads the template called "polls/index.html" and passes it a context. The context is a dictionary mapping template variable names to Python objects. Reload the page. Now you'll see an error:: - TemplateDoesNotExist: Your TEMPLATE_DIRS settings is empty. - Change it to point to at least one template directory. + TemplateDoesNotExist at /polls/ + polls/index.html Ah. There's no template yet. First, create a directory, somewhere on your filesystem, whose contents Django can access. (Django runs as whatever user |
