10๐
Celery (since version 4 as pointed out by another answer) does not support Windows (source: http://docs.celeryproject.org/en/latest/faq.html#does-celery-support-windows). Even so, you have some options:
1) Use task_always_eager=True
. This will run your tasks synchronously โ with this, you can verify that your code is doing what itโs supposed to do. Running tasks synchronously works even on Windows.
More info: http://docs.celeryproject.org/en/latest/userguide/configuration.html#std:setting-task_always_eager
2) Use WSL (Windows Subsystem for Linux).
More info: https://learn.microsoft.com/en-us/windows/wsl/install-win10#install-the-windows-subsystem-for-linux
3) Use Docker for Windows. You can run Celery Worker(s) and Celery Beat inside the container.
More info: https://docs.docker.com/docker-for-windows/
Personally, I use option 1) for unit testing and option 2) for development.
3๐
There are two workarounds to make Celery work (natively) on Windows โ and therefore be able to test it as if it were on Linux.
- use eventlet, gevent or solo concurrency pool (if your tasks as I/O and not CPU-bound)
- set the environment variable FORKED_BY_MULTIPROCESS=1 (this is what actually causes the underlying billiard package to to fail under Windows since version 4)
https://www.distributedpython.com/2018/08/21/celery-4-windows/
- [Django]-Django modeltranslation โ can't get and see original fields
- [Django]-Django: Values_list returns id from choice field instead of name
- [Django]-Django: export current queryset to csv by button click in browser
0๐
Actually you cant. Since Celery 4.x, Windows is no longer supported due to lack of resources. This is what official documentation of celery says.
- [Django]-OAuth2 specification states that 'perms' should now be called 'scope'. Please update. Django Facebook connect
- [Django]-Django ImageField not uploading the image
0๐
Donโt know if celery is supported or not in windows officially now, but i am able to use celery directly on windows without any other workarounds.
currently installed it with pip install celery==5.0.5
. I am successfully able to run background tasks and perform other features also from my Django app through Redis as broker.
Otherwise the best way for development purpose will be to use WSL as pointed out by others, although it has itโs own pros and cons.
- [Django]-Is there a way to transfer images between Django Rest Framework and Flutter app?
- [Django]-Getting 400's from aws ELB hostcheck to work with django ALLOWED_HOSTS in aws ECS under awsvpc networking mode?
- [Django]-How should I upgrade from bradjasper's django-jsonfield to Django's built-in jsonfield?
- [Django]-Getting 'TooBig' Memcachier exception on a Django Rest Framework response on Heroku