update celery to a version that works in python3.7
This commit is contained in:
parent
de14061b68
commit
62fe578f38
4 changed files with 9 additions and 9 deletions
|
@ -10,7 +10,7 @@ from django.db.models import Count, Q
|
||||||
|
|
||||||
from six import string_types
|
from six import string_types
|
||||||
from celery.utils import get_full_cls_name
|
from celery.utils import get_full_cls_name
|
||||||
from celery.backends import default_backend
|
from celery._state import current_app
|
||||||
import ox
|
import ox
|
||||||
from oxdjango.decorators import login_required_json
|
from oxdjango.decorators import login_required_json
|
||||||
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
from oxdjango.shortcuts import render_to_json_response, get_object_or_404_json, json_response
|
||||||
|
@ -390,8 +390,11 @@ def getTaskStatus(request, data):
|
||||||
else:
|
else:
|
||||||
task_id = data['task_id']
|
task_id = data['task_id']
|
||||||
response = json_response(status=200, text='ok')
|
response = json_response(status=200, text='ok')
|
||||||
status = default_backend.get_status(task_id)
|
|
||||||
res = default_backend.get_result(task_id)
|
backend = current_app.backend
|
||||||
|
status = backend.get_status(task_id)
|
||||||
|
res = backend.get_result(task_id)
|
||||||
|
|
||||||
response['data'] = {
|
response['data'] = {
|
||||||
'id': task_id,
|
'id': task_id,
|
||||||
'status': status
|
'status': status
|
||||||
|
|
|
@ -6,8 +6,6 @@ from __future__ import absolute_import
|
||||||
|
|
||||||
import os
|
import os
|
||||||
from os.path import join, normpath, dirname
|
from os.path import join, normpath, dirname
|
||||||
import djcelery
|
|
||||||
djcelery.setup_loader()
|
|
||||||
|
|
||||||
BASE_DIR = PROJECT_ROOT = normpath(dirname(__file__))
|
BASE_DIR = PROJECT_ROOT = normpath(dirname(__file__))
|
||||||
BIN_DIR = normpath(join(PROJECT_ROOT, '..', 'bin'))
|
BIN_DIR = normpath(join(PROJECT_ROOT, '..', 'bin'))
|
||||||
|
@ -122,7 +120,7 @@ INSTALLED_APPS = (
|
||||||
'django.contrib.humanize',
|
'django.contrib.humanize',
|
||||||
|
|
||||||
'django_extensions',
|
'django_extensions',
|
||||||
'djcelery',
|
'django_celery_results',
|
||||||
'app',
|
'app',
|
||||||
'log',
|
'log',
|
||||||
'annotation',
|
'annotation',
|
||||||
|
|
|
@ -4,7 +4,6 @@ from __future__ import division, print_function, absolute_import
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from celery.backends import default_backend
|
|
||||||
from celery.utils import get_full_cls_name
|
from celery.utils import get_full_cls_name
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
Django==1.11.22
|
Django==1.11.22
|
||||||
simplejson
|
simplejson
|
||||||
chardet
|
chardet
|
||||||
celery==3.1.26.post2
|
celery>4
|
||||||
django-celery==3.2.2
|
django-celery-results
|
||||||
django-extensions==2.0.7
|
django-extensions==2.0.7
|
||||||
gunicorn==19.8.1
|
gunicorn==19.8.1
|
||||||
html5lib
|
html5lib
|
||||||
|
|
Loading…
Reference in a new issue