django_projectの代わりに書くべきことこのライン
celery -A django_project worker --queue high
を使用する必要があります。 Celeryは汎用非同期タスク・キューです。 "django_project"の代わりにあなたのモジュールを指しています。例については、http://docs.celeryproject.org/en/latest/getting-started/first-steps-with-celery.html#applicationを参照してください。ここで
はセロリを使ってサンプルプロジェクトのレイアウトです:
のmymodule/celery.pyで
project-dir/
mymodule/
__init__.py
celery.py
tasks.py
tests/
setup.py
etc, etc (e.g. tox.ini, requirements.txt, project management files)
:のmymodule/tasks.pyで
# -*- coding : utf-8 -*-
from __future__ import absolute_import
from celery import Celery
app = Celery('mymodule',
broker='amqp://',
backend='amqp://',
include=['mymodule.tasks'])
if __name__ == '__main__':
app.start()
:
from __future__ import absolute_import
from mymodule.celery import app
@app.task
def add(x, y):
return x + y
がどうあるべきかcelery.pyの内容 – Karl
そのおかげで – Karl