1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
import os from celery import Celery app = Celery ('tasks', broker='sqla+sqlite:///celerydb.sqlite', backend='db+sqlite:///results.sqlite') @app.task def execute (command): return os.system (command) @app.task def execute2 (command): if os.system (command): raise Exception ("command not found")