Django

Code

Changeset 3295

Show
Ignore:
Timestamp:
07/07/06 17:25:32 (2 years ago)
Author:
adrian
Message:

Fixed #2295 -- Improved docs/sessions.txt to note INSTALLED_APPS requirement.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/docs/sessions.txt

    r3049 r3295  
    1111================= 
    1212 
    13 Sessions are implemented via middleware_. 
    14  
    15 Turn session functionality on and off by editing the ``MIDDLEWARE_CLASSES`` 
    16 setting. To activate sessions, make sure ``MIDDLEWARE_CLASSES`` contains 
    17 ``'django.contrib.sessions.middleware.SessionMiddleware'``. 
    18  
    19 The default ``settings.py`` created by ``django-admin.py startproject`` has 
    20 ``SessionMiddleware`` activated. 
     13Sessions are implemented via a piece of middleware_ and a Django model. 
     14 
     15To enable session functionality, do these two things: 
     16 
     17    * Edit the ``MIDDLEWARE_CLASSES`` setting and make sure 
     18      ``MIDDLEWARE_CLASSES`` contains ``'django.contrib.sessions.middleware.SessionMiddleware'``. 
     19      The default ``settings.py`` created by ``django-admin.py startproject`` has 
     20      ``SessionMiddleware`` activated. 
     21 
     22    * Add ``'django.contrib.sessions'`` to your ``INSTALLED_APPS`` setting, and 
     23      run ``manage.py syncdb`` to install the single database table that stores 
     24      session data. 
    2125 
    2226If you don't want to use sessions, you might as well remove the 
    23 ``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES``. It'll save you a small 
    24 bit of overhead. 
     27``SessionMiddleware`` line from ``MIDDLEWARE_CLASSES`` and ``'django.contrib.sessions'`` 
     28from your ``INSTALLED_APPS``. It'll save you a small bit of overhead. 
    2529 
    2630.. _middleware: http://www.djangoproject.com/documentation/middleware/