Skip to content
Myr

README.md

This file

Path

examples/celery/README.md

27 lines · 950 bytes · Markdown

Last changed by

Not known.

History of this file

Take it

The walk stopped after 200 commits: lines older than 73739a2 point at it.

Merge branch '2.2.x'David Lordbefore adoption73739a2

lines 1–27why, one step back
1Background Tasks with Celery
2============================34This example shows how to configure Celery with Flask, how to set up an API for5submitting tasks and polling results, and how to use that API with JavaScript. See6[Flask's documentation about Celery](https://flask.palletsprojects.com/patterns/celery/).78From this directory, create a virtualenv and install the application into it. Then run a9Celery worker.1011```shell12$ python3 -m venv .venv13$ . ./.venv/bin/activate14$ pip install -r requirements.txt && pip install -e .15$ celery -A make_celery worker --loglevel INFO16```1718In a separate terminal, activate the virtualenv and run the Flask development server.1920```shell21$ . ./.venv/bin/activate22$ flask -A task_app run --debug23```2425Go to http://localhost:5000/ and use the forms to submit tasks. You can see the polling26requests in the browser dev tools and the Flask logs. You can see the tasks submitting27and completing in the Celery logs.