Setting up Celery and RabbitMQ
To install Celery with pip
, run the following:
$ pip install Celery
We will also need a Flask extension to help handle initializing 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 installed. RabbitMQ is not written in Python; therefore, installation instructions will be different for every OS. Thankfully, RabbitMQ maintains a detailed list of instructions for each OS at https://www.rabbitmq.com/download.html.
After RabbitMQ is installed, go to a terminal window and run the following:
$ rabbitmq-server
This will start a RabbitMQ server with a user of guest and a password of guest. By default, RabbitMQ only accepts connections on localhost, so this setup is...