Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Django 1.10 support #108

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ python:
- 3.2
- 3.3
- 3.4
- 3.5

env:
- DJANGO_VERSION="Django==1.3.7"
Expand All @@ -13,6 +14,7 @@ env:
- DJANGO_VERSION="Django==1.6.7"
- DJANGO_VERSION="Django==1.7.0"
- DJANGO_VERSION="Django==1.8.0"
- DJANGO_VERSION="Django==1.10.1"

matrix:
exclude:
Expand Down
9 changes: 7 additions & 2 deletions corsheaders/middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
except ImportError:
from django.db.models.loading import get_model

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

from corsheaders import defaults as settings


Expand All @@ -23,7 +28,7 @@
ACCESS_CONTROL_MAX_AGE = 'Access-Control-Max-Age'


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

def _https_referer_replace_reverse(self, request):
"""
Expand All @@ -45,7 +50,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
21 changes: 20 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ envlist =
py27-django16,
py27-django17,
py27-django18,
py27-django110,
py32-django15,
py32-django16,
py32-django17,
Expand All @@ -23,6 +24,8 @@ envlist =
py34-django16,
py34-django17,
py34-django18,
py34-django110,
py35-django110,

[testenv]
commands = python setup.py test
Expand All @@ -45,6 +48,9 @@ deps = django == 1.7.0
[django18]
deps = django == 1.8.0

[django110]
deps = django == 1.10.1

[testenv:py26-django13]
basepython = python2.6
deps = {[django13]deps}
Expand Down Expand Up @@ -86,6 +92,10 @@ deps = {[django17]deps}
basepython = python2.7
deps = {[django18]deps}

[testenv:py27-django110]
basepython = python2.7
deps = {[django110]deps}


[testenv:py32-django15]
basepython = python3.2
Expand Down Expand Up @@ -134,5 +144,14 @@ basepython = python3.4
deps = {[django17]deps}

[testenv:py34-django18]
basepython = python3.3
basepython = python3.4
deps = {[django14]deps}

[testenv:py34-django110]
basepython = python3.4
deps = {[django110]deps}


[testenv:py35-django110]
basepython = python3.5
deps = {[django110]deps}