Fixed imports, indention, and a long line.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@6628 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Gary Wilson Jr 2007-10-29 23:55:08 +00:00
parent 48ce8456cb
commit a7a6a1b75d
1 changed files with 7 additions and 5 deletions

View File

@ -1,8 +1,9 @@
import time
import datetime
from email.Utils import formatdate
from django.conf import settings
from django.utils.cache import patch_vary_headers
from email.Utils import formatdate
import datetime
import time
TEST_COOKIE_NAME = 'testcookie'
TEST_COOKIE_VALUE = 'worked'
@ -10,8 +11,9 @@ TEST_COOKIE_VALUE = 'worked'
class SessionMiddleware(object):
def process_request(self, request):
engine = __import__(settings.SESSION_ENGINE, {}, {}, [''])
request.session = engine.SessionStore(request.COOKIES.get(settings.SESSION_COOKIE_NAME, None))
engine = __import__(settings.SESSION_ENGINE, {}, {}, [''])
session_key = request.COOKIES.get(settings.SESSION_COOKIE_NAME, None)
request.session = engine.SessionStore(session_key)
def process_response(self, request, response):
# If request.session was modified, or if response.session was set, save