我正在学习姜戈。最近我尝试使用芹菜。我面临的问题是任务正在接收但它们没有执行。
设置.py:
# Celery application definition
CELERY_BROKER_URL = 'redis://localhost:6379'
CELERY_RESULT_BACKEND = 'redis://localhost:6379'
CELERY_ACCEPT_CONTENT = ['application/json']
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_TIMEZONE = 'Asia/Tehran'
Run Code Online (Sandbox Code Playgroud)
芹菜.py:
from __future__ import absolute_import, unicode_literals
import os
from celery import Celery
# set the default Django settings module for the 'celery' program.
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myshop.settings')
app = Celery('myshop')
app.config_from_object('django.conf.settings', namespace='CELERY')
app.autodiscover_tasks()
@app.task(bind=True)
def debug_task(self):
print('Request: {0!r}'.format(self.request))
Run Code Online (Sandbox Code Playgroud)
任务.py:
from celery import task, shared_task
from django.core.mail import send_mail
from .models import Order
import logging
# Get an instance …Run Code Online (Sandbox Code Playgroud) 我正在迁移到 google drive api v3 并根据此示例更新依赖项,如下所示:
implementation 'com.google.android.gms:play-services-auth:16.0.1'
implementation 'com.google.http-client:google-http-client-gson:1.26.0'
implementation('com.google.api-client:google-api-client-android:1.26.0') {
exclude group: 'org.apache.httpcomponents'
}
implementation('com.google.apis:google-api-services-drive:v3-rev136-1.25.0') {
exclude group: 'org.apache.httpcomponents'
}
Run Code Online (Sandbox Code Playgroud)
但我正面临这个错误:
发现多个文件与操作系统独立路径“META-INF/DEPENDENCIES”
并且无法运行该应用程序