Skip to content

Instantly share code, notes, and snippets.

@andrealmar
Created December 22, 2016 14:49
Show Gist options
  • Select an option

  • Save andrealmar/7fde597a67bacd43512c54ead7552459 to your computer and use it in GitHub Desktop.

Select an option

Save andrealmar/7fde597a67bacd43512c54ead7552459 to your computer and use it in GitHub Desktop.
from __future__ import absolute_import, unicode_literals
from celery import current_app
from celery.bin import worker
if __name__ == '__main__':
app = current_app._get_current_object()
worker = worker.worker(app=app)
# You bootstrap code here
options = {
'broker': 'amqp://guest:guest@localhost:5672//',
'loglevel': 'INFO',
'traceback': True,
}
worker.run(**options)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment