Next, we create an instance of the class (called app) and pass our module name which is celery_demo in our case, the url of our redis server (running on localhost on the default port 6379) and lastly the link to our SQLite database which will store the task results.First, we import the Celery class from the celery module.# module name - celery_demo.py from celery import Celery app = Celery ( "celery_demo", broker = "redis://localhost:6379", backend = "db+sqlite:///results.db" ) def multiply ( num1, num2 ): return num1 * num2
Install redis on windows 10 install#
Running the following commands in WSL will install a Redis server on your computer. The final thing we need to do before writing our code is to install a Redis server instance locally. Once installed, we will have an option to reopen our (Windows) project folder in WSL. This plugin can be installed from the VS Code marketplace. in the consoleĪs mentioned earlier, we will be using the Remote-WSL extension to run our code in a Linux based environment.
Install redis on windows 10 how to#
In this post, we will see how to install and run Celery using Windows Subsystem for Linux (WSL) on Windows 10. It requires a messaging queue (also known as a broker) to send and receive messages. Celery is an asynchronous task queue that is fairly easy to integrate with a Python application.