django-celery

Can't pickle : attribute lookup builtin.function failed

匆匆过客 提交于 2021-01-27 05:19:18
问题 I'm getting the error below, the error only happens when I add delay to process_upload function, otherwise it works without a problem. Could someone explain what this error is, why its happening and any recommendations to resolve? Error: PicklingError at /contacts/upload/configurator/47/ Can't pickle <type 'function'>: attribute lookup __builtin__.function failed This is the view if request.method == 'POST': form = ConfiguratorForm(data=request.POST) # Send import to task. process_upload

How to register Celery task to specific worker?

一笑奈何 提交于 2021-01-04 07:19:22
问题 I am developing web application in Python/Django, and I have several tasks which are running in celery. I have to run task A one at a time so I have created worker with --concurrency=1 and routed task A to that worker using following command. celery -A proj worker -Q A -c 1 -l INFO Everything is working fine as this worker handle task A and other tasks are routed to default queue. But, above worker return all task when I use inspect command to get registered task for worker. That is

celery worker only imports tasks when not detached

假装没事ソ 提交于 2020-12-12 10:01:37
问题 I'm trying to get my django app to submit tasks to a celery worker and it's succeeding when the worker is run attached. As soon as I add the --detach the tasks are failing to be registered. [2020-10-26 04:09:33,159: ERROR/MainProcess] Received unregistered task of type 'devapp.tasks.create_random_files'. The message has been ignored and discarded. Did you remember to import the module containing this task? Or maybe you're using relative imports? Please see http://docs.celeryq.org/en/latest

celery worker only imports tasks when not detached

亡梦爱人 提交于 2020-12-12 10:00:48
问题 I'm trying to get my django app to submit tasks to a celery worker and it's succeeding when the worker is run attached. As soon as I add the --detach the tasks are failing to be registered. [2020-10-26 04:09:33,159: ERROR/MainProcess] Received unregistered task of type 'devapp.tasks.create_random_files'. The message has been ignored and discarded. Did you remember to import the module containing this task? Or maybe you're using relative imports? Please see http://docs.celeryq.org/en/latest

celery worker only imports tasks when not detached

一曲冷凌霜 提交于 2020-12-12 10:00:34
问题 I'm trying to get my django app to submit tasks to a celery worker and it's succeeding when the worker is run attached. As soon as I add the --detach the tasks are failing to be registered. [2020-10-26 04:09:33,159: ERROR/MainProcess] Received unregistered task of type 'devapp.tasks.create_random_files'. The message has been ignored and discarded. Did you remember to import the module containing this task? Or maybe you're using relative imports? Please see http://docs.celeryq.org/en/latest

Periodic tasks in Django/Celery - How to notify the user on screen?

。_饼干妹妹 提交于 2020-08-22 05:15:28
问题 I have now succesfully setup Django-celery to check after my existing tasks to remind the user by email when the task is due: @periodic_task(run_every=datetime.timedelta(minutes=1)) def check_for_tasks(): tasks = mdls.Task.objects.all() now = datetime.datetime.utcnow().replace(tzinfo=utc,second=00, microsecond=00) for task in tasks: if task.reminder_date_time == now: sendmail(...) So far so good, however what if I wanted to also display a popup to the user as a reminder? Twitter bootstrap