Questions tagged [django-celery]

Django-celery provides Celery integration for Django.

Django-celery provides Celery integration for Django.

1738 questions
30
votes
4 answers

Django and Celery - re-loading code into Celery after a change

If I make a change to tasks.py while celery is running, is there a mechanism by which it can re-load the updated code? or do I have to shut Celery down a re-load? I read celery had an --autoreload argument in older versions, but I can't find it in…
JasonGenX
  • 4,952
  • 27
  • 106
  • 198
29
votes
1 answer

Examples of Django and Celery: Periodic Tasks

I have been fighting the Django/Celery documentation for a while now and need some help. I would like to be able to run Periodic Tasks using django-celery. I have seen around the internet (and the documentation) several different formats and schemas…
Jonathan May
  • 431
  • 1
  • 5
  • 9
29
votes
3 answers

Create celery tasks then run synchronously

My app gathers a bunch of phone numbers on a page. Once the user hits the submit button I create a celery task to call each number and give a reminder message then redirect them to a page where they can see the live updates about the call. I am…
Austin
  • 4,296
  • 6
  • 40
  • 52
28
votes
2 answers

Django Celery: Admin interface showing zero tasks/workers

I've setup Celery with Django ORM as back-end. Trying to monitor what's going on behind the scene. I've started celeryd with -E flag python manage.py celeryd -E -l INFO -v 1 -f /path/to/celeryd.log Started celerycam with default snapshot frequency…
rubayeet
  • 9,269
  • 8
  • 46
  • 55
28
votes
3 answers

How to route tasks to different queues with Celery and Django

I am using the following stack: Python 3.6 Celery v4.2.1 (Broker: RabbitMQ v3.6.0) Django v2.0.4. According Celery's documentation, running scheduled tasks on different queues should be as easy as defining the corresponding queues for the tasks on…
Ander
  • 5,093
  • 7
  • 41
  • 70
28
votes
3 answers

Add n tasks to celery queue and wait for the results

I'd add several jobs to the celery queue and wait for the results. I have many ideas about how I would accomplish this using some type of shared storage (memcached, redis, database, etc.), but I think it was something Celery could handle…
Prydie
  • 1,807
  • 1
  • 20
  • 30
28
votes
6 answers

Starting Celery: AttributeError: 'module' object has no attribute 'celery'

I try to start a Celery worker server from a command line: celery -A tasks worker --loglevel=info The code in tasks.py: import os os.environ[ 'DJANGO_SETTINGS_MODULE' ] = "proj.settings" from celery import task @task() def add_photos_task( lad_id…
sergzach
  • 6,578
  • 7
  • 46
  • 84
26
votes
1 answer

Python Celery versus Threading Library for running async requests

I am running a python method that parses a lot of data. Since it is time intensive, I would like to run it asynchronously on a separate thread so the user can still access the website/UI. Do threads using the "from threading import thread" module…
ninajay
  • 527
  • 1
  • 5
  • 10
26
votes
3 answers

Celery stop execution of a chain

I have a check_orders task that's executed periodically. It makes a group of tasks so that I can time how long executing the tasks took, and perform something when they're all done (this is the purpose of res.join [1] and grouped_subs) The tasks…
Salami
  • 2,849
  • 4
  • 24
  • 33
24
votes
5 answers

Resolving circular imports in celery and django

I have a Django app that uses Celery to offload some tasks. Mainly, it defers the computation of some fields in a database table. So, I have a tasks.py: from models import MyModel from celery import shared_task @shared_task def my_task(id): qs…
Chinmay Kanchi
  • 62,729
  • 22
  • 87
  • 114
23
votes
1 answer

Celery: per task concurrency limits (# of workers per task)?

Is it possible to set the concurrency (the number of simultaneous workers) on a per-task level in Celery? I'm looking for something more fine-grained that CELERYD_CONCURRENCY (that sets the concurrency for the whole daemon). The usage scenario is: I…
Parand
  • 102,950
  • 48
  • 151
  • 186
23
votes
4 answers

Recover from task failed beyond max_retries

I am attempting to asynchronously consume a web service because it takes up to 45 seconds to return. Unfortunately, this web service is also somewhat unreliable and can throw errors. I have set up django-celery and have my tasks executing, which…
Jack M.
  • 30,350
  • 7
  • 55
  • 67
23
votes
2 answers

Celery, calling delay with countdown

I'm trying to understand how celery works In my django application in tasks.py file I have created one task: @celery.shared_task(default_retry_delay=2 * 60, max_retries=2) def my_task(param1, param2): # There are some operations I call this…
Mr.D
  • 7,353
  • 13
  • 60
  • 119
23
votes
3 answers

Celery (Redis) results backend not working

I have a web application using Django and i am using Celery for some asynchronous tasks processing. For Celery, i am using Rabbitmq as a broker, and Redis as a result backend. Rabbitmq and Redis are running on the same Ubuntu 14.04 server hosted on…
Soufiaane
  • 1,737
  • 6
  • 24
  • 45
22
votes
4 answers

Django-Celery progress bar

I use: Celery Django-Celery RabbitMQ I can see all my tasks in the Django admin page, but at the moment it has just a few states, like: RECEIVED RETRY REVOKED SUCCESS STARTED FAILURE PENDING It's not enough information for…
derevo
  • 9,048
  • 2
  • 22
  • 19