Skip to content

Commit

Permalink
Merge pull request #66 from zodman/add_middleware_session
Browse files Browse the repository at this point in the history
adding missing middleware for session installed
  • Loading branch information
juancarlospaco committed Mar 27, 2015
2 parents 19e904d + d78cc10 commit c819204
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions importd/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,14 @@ def _configure_django(self, **kw):
installed.append("django.contrib.messages")
if "django.contrib.sessions" not in installed:
installed.append("django.contrib.sessions")
# check session middleware installed
# https://docs.djangoproject.com/en/1.7/topics/http/sessions/#enabling-sessions
last_position = len(kw["MIDDLEWARE_CLASSES"])
kw["MIDDLEWARE_CLASSES"] = list(kw["MIDDLEWARE_CLASSES"])
kw["MIDDLEWARE_CLASSES"].insert(
last_position,
"django.contrib.sessions.middleware.SessionMiddleware"
)
if "django.contrib.admin" not in installed:
installed.append("django.contrib.admin")
if "django.contrib.humanize" not in installed:
Expand Down

0 comments on commit c819204

Please sign in to comment.