Django 2.0 compatibility

- django.core.urlresolvers -> django.urls
- fix major/minor version detection
This commit is contained in:
Adam Chidlow
2017-11-01 18:23:14 +08:00
parent aef4a38097
commit bebe1ba64f
3 changed files with 11 additions and 6 deletions
+2 -3
View File
@@ -1,6 +1,6 @@
import os
import sys
from django import get_version
import django
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath)
@@ -11,8 +11,7 @@ default_app_config = 'django_q.apps.DjangoQConfig'
# root imports will slowly be deprecated.
# please import from the relevant sub modules
split_version = get_version().split('.')
if split_version[1] not in ('9', '10', '11'):
if django.VERSION[:2] < (1, 9):
from .tasks import async, schedule, result, result_group, fetch, fetch_group, count_group, delete_group, queue_size
from .models import Task, Schedule, Success, Failure
from .cluster import Cluster