mirror of
https://github.com/django-q2/django-q2.git
synced 2026-10-03 12:38:12 +08:00
Django 2.0 compatibility
- django.core.urlresolvers -> django.urls - fix major/minor version detection
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user