Skip to content

Commit

Permalink
Test project: correctly set middleware for different Django versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco Braak committed Oct 22, 2016
1 parent bb9d15b commit 88e66fb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions testproject/settings.py
@@ -1,6 +1,8 @@
import os
import sys

import django


base_dir = os.path.abspath(os.path.dirname(__file__))

Expand Down Expand Up @@ -88,6 +90,9 @@
'django.contrib.messages.middleware.MessageMiddleware',
)

if django.VERSION[0:2] <= (1, 9):
MIDDLEWARE_CLASSES = MIDDLEWARE

ROOT_URLCONF = 'urls'

TEMPLATE_DIRS = []
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Expand Up @@ -4,7 +4,7 @@ envlist = {py27,py35}-{django18,django19,django110},pypy-django18
[testenv]
changedir = {toxinidir}/testproject
setenv =
PYTHONWARNINGS = default
PYTHONWARNINGS = default
deps =
-r{toxinidir}/testproject/requirements_test.txt
django18: Django>=1.8,<1.9
Expand Down

0 comments on commit 88e66fb

Please sign in to comment.