if __name__ == '__main__':
    app = current_app._get_current_object()
worker = worker.worker(app=app)
options = {'broker': 'amqp://guest:guest@localhost:5672//', 'loglevel':
    'INFO', 'traceback': True}
worker.run(**options)
How to start a Celery worker from a script/module __main__?