I have Django application that was using Celery version 4.4.2, which was working fine.
from celery import task
import logging
@task(ignore_result=True)
def log_user_activity(user_id):
try:
logging.info(user_id)
except Exception as e:
logging.error(str(e))
As I tried to update the Celery version to v5.2.2 I get below error:
ImportError: cannot import name 'task' from 'celery'
Can someone help what is task been replaced with? they still have example here with same. https://github.com/celery/celery/blob/v5.2.2/examples/celery_http_gateway/tasks.py