Changes between Version 5 and Version 6 of BackwardsIncompatibleChanges


Ignore:
Timestamp:
Aug 16, 2005, 5:54:41 PM (19 years ago)
Author:
Adrian Holovaty
Comment:

Added "anonymous sessions" section.

Legend:

Unmodified
Added
Removed
Modified
  • BackwardsIncompatibleChanges

    v5 v6  
    6161ALTER TABLE auth_admin_log MODIFY object_id TEXT;
    6262}}}
     63
     64== Added support for anonymous sessions ==
     65
     66As of [518], Django has support for anonymous sessions. If you're using a Django database installation from before [518] and you want to use the Django admin, anonymous sessions or auth-based sessions, you'll need to make a few updates to your database and settings files.
     67
     68=== Change your settings files ===
     69
     70Add {{{"django.middleware.sessions.SessionMiddleware"}}} to the {{{MIDDLEWARE_CLASSES}}} tuple in your admin settings file. Make sure it appears before {{{"django.middleware.admin.AdminUserRequired"}}}. (The middleware classes are applied in order, and the admin middleware requires that the session middleware come first.)
     71
     72If you want session support any other (i.e., non-admin) Django installation, change the {{{MIDDLEWARE_CLASSES}}} setting accordingly. The order (i.e., whether it comes before or after the other installed middleware classes) doesn't matter.
     73
     74=== Create the core_sessions database table ===
     75
     76In PostgreSQL, use this:
     77
     78{{{
     79CREATE TABLE core_sessions (
     80    session_key varchar(40) NOT NULL PRIMARY KEY,
     81    session_data text NOT NULL,
     82    expire_date timestamp with time zone NOT NULL
     83);
     84INSERT INTO content_types (name, package, python_module_name) VALUES ('session', 'core', 'sessions');
     85}}}
     86
     87In MySQL and SQLite, use this:
     88
     89{{{
     90CREATE TABLE core_sessions (
     91    session_key varchar(40) NOT NULL PRIMARY KEY,
     92    session_data text NOT NULL,
     93    expire_date datetime NOT NULL
     94);
     95}}}
     96
     97=== Remove old, unneeded things ===
     98
     99Execute this SQL in your database:
     100
     101{{{
     102DROP TABLE auth_sessions;
     103DELETE FROM content_types WHERE package = 'auth' AND python_module_name = 'sessions';
     104}}}
     105
     106Edit your settings file(s) to remove {{{AUTH_SESSION_COOKIE}}} and {{{REGISTRATION_COOKIE_DOMAIN}}}, if they exist.
Back to Top