from celery import shared_task @shared_task def send_mail(provider=None, **kwargs): return provider().send_mail(**kwargs)