Skip to content

Commit

Permalink
Add SessionAuthenticationMiddleware if available.
Browse files Browse the repository at this point in the history
  • Loading branch information
dracos committed Feb 11, 2015
1 parent 4f83039 commit 5432eff
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

1 comment on commit 5432eff

@mhl
Copy link
Contributor

@mhl mhl commented on 5432eff Feb 12, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd probably add a note in the commit message about why you're adding SessionAuthenticationMiddleware to save people looking it up

Please sign in to comment.