Skip to content

Commit

Permalink
Upgrade suport to django 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
valdergallo committed Dec 14, 2015
1 parent a3bafd8 commit a375b07
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion data_importer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@
# from django.contrib.auth import get_user_model
User = settings.AUTH_USER_MODEL

DJANGO_VERSION = float(django.get_version())

if float(django.get_version()) < 1.7:
if DJANGO_VERSION > 1.7:
from django.contrib.contenttypes.fields import GenericForeignKey # for Django > 1.7
else:
from django.contrib.contenttypes.generic import GenericForeignKey # for Django < 1.9
Expand Down
2 changes: 1 addition & 1 deletion data_importer/writers/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def save(self, compress=True, filename=None):

def response(self, compress=True, filename=None):
from django.http import HttpResponse
from django.core.servers.basehttp import FileWrapper
from wsgiref.util import FileWrapper

if compress:
response = HttpResponse(FileWrapper(self.get_compressed_file()))
Expand Down
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

[tox]
skipsdist = true
envlist = py27-django{13,14,15,16}
# envlist = py27-django{12,13,14,15,16,17,18,19},
# envlist = py27-django{13,14,15,16}
envlist = py27-django{12,13,14,15,16,17,18,19},


[testenv]
Expand Down

0 comments on commit a375b07

Please sign in to comment.