To install Celery on our virtualenv, we need to add it to our requirements.txt file:
...
Celery
...
As always, use the provided init.sh script, or use the procedure explained here to create and install all dependencies on a Python virtual environment.
We will also need a Flask extension to help handle the initialization of Celery:
$ pip install Flask-Celery-Helper
The Flask documentation states that Flask extensions for Celery are unnecessary. However, getting the Celery server to work with Flask's application context, when your app is organized with an application factory, is significant. So, we will use Flask-Celery-Helper to do the heavy lifting.
Next, RabbitMQ needs to be up and running. To do this easily, we will use a Docker container. Make sure you have Docker installed and properly set up; if not, then check out Chapter 1, Getting Started...