Skip to content

Commit

Permalink
Add SessionAuthenticationMiddleware if available.
Browse files Browse the repository at this point in the history
This was added in Django 1.7 in order to invalidate sessions on password
change.
  • Loading branch information
dracos committed Feb 12, 2015
1 parent 4f83039 commit fc2f6c3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions project/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
# similar ETag code in CommonMiddleware.
USE_ETAGS = False

MIDDLEWARE_CLASSES = (
MIDDLEWARE_CLASSES = [
'mapit.middleware.gzip.GZipMiddleware',
# Not 'django.middleware.gzip.GZipMiddleware' to work around Django #24242
'django.middleware.http.ConditionalGetMiddleware',
Expand All @@ -177,7 +177,9 @@
'django.middleware.cache.FetchFromCacheMiddleware',
'mapit.middleware.JSONPMiddleware',
'mapit.middleware.ViewExceptionMiddleware',
)
]
if django.get_version() >= '1.7':
MIDDLEWARE_CLASSES.append('django.contrib.auth.middleware.SessionAuthenticationMiddleware')

ROOT_URLCONF = 'project.urls'

Expand Down

0 comments on commit fc2f6c3

Please sign in to comment.