这是我的项目结构
myproj
│
├── app1
├── __init__.py
├── tasks.py
gettingstarted
├── __init__.py
├── urls.py
├── settings.py
│
├── manage.py
|-- Procfile
在入门/设置中:
BROKER_URL = 'redis://'
在Procfile中:
web: gunicorn gettingstarted.wsgi --log-file -
worker: celery worker --app=app1.tasks.app
在app1 / tasks.py
中 from __future__ import absolute_import, unicode_literals
import random
import celery
import os
app = celery.Celery('hello')
@app.task
def add(x, y):
return x + y
请帮助...。我一直在尝试解决这一问题,已连续24小时.....