A task decorator that uses the django-cereal pickler as the default serializer.

def task(func, *args, **kwargs):
    """
    A task decorator that uses the django-cereal pickler as the default serializer.
    """

    # Note we must import here to avoid recursion issue with kombu entry points registration
    from celery import shared_task

    if 'serializer' not in kwargs:
        kwargs['serializer'] = DJANGO_CEREAL_PICKLE
    return shared_task(func, *args, **kwargs)