Skip to content

Commit

Permalink
Django 1.10 support
Browse files Browse the repository at this point in the history
  • Loading branch information
fanhan authored and Adam Chainz committed Sep 28, 2016
1 parent 1642f7d commit 870b1d9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 7 additions & 2 deletions corsheaders/middleware.py
Expand Up @@ -8,6 +8,11 @@

from django.apps import apps

try:
from django.utils.deprecation import MiddlewareMixin
except ImportError:
MiddlewareMixin = object

from corsheaders import defaults as settings


Expand All @@ -19,7 +24,7 @@
ACCESS_CONTROL_MAX_AGE = 'Access-Control-Max-Age'


class CorsPostCsrfMiddleware(object):
class CorsPostCsrfMiddleware(MiddlewareMixin):

def _https_referer_replace_reverse(self, request):
"""
Expand All @@ -41,7 +46,7 @@ def process_view(self, request, callback, callback_args, callback_kwargs):
return None


class CorsMiddleware(object):
class CorsMiddleware(MiddlewareMixin):

def _https_referer_replace(self, request):
"""
Expand Down
3 changes: 2 additions & 1 deletion tox.ini
@@ -1,12 +1,13 @@
[tox]
envlist =
py{27,35}-codestyle,
py{27,35}-django{18,19}
py{27,35}-django{18,19,110}

[testenv]
deps =
django18: Django>=1.8,<1.9
django19: Django>=1.9,<1.10
django110: Django>=1.10,<1.11
commands = python setup.py test

[testenv:py27-codestyle]
Expand Down

0 comments on commit 870b1d9

Please sign in to comment.