def configure_celery_app(app, celery):
 app.config.update({'BROKER_URL': app.config['CELERY_BROKER_URL']})
 celery.conf.update(app.config)
 TaskBase = celery.Task
 class ContextTask(TaskBase, ):
  abstract = True
  def __call__(self, *args, **kwargs):
   with app.app_context():
    return TaskBase.__call__(self, *args, **kwargs)
 celery.Task = ContextTask

def configure_celery_app ( app , celery ) : app . config . update ( { 'BROKER_URL' : app . config [ 'CELERY_BROKER_URL' ] } ) celery . conf . update ( app . config ) TaskBase = celery . Task class ContextTask ( TaskBase , ) : abstract = True def __call__ ( self , * args , ** kwargs ) : with app . app_context ( ) : return TaskBase . __call__ ( self , * args , ** kwargs ) celery . Task = ContextTask
configures the celery app .