Skip to content

Instantly share code, notes, and snippets.

@pyghassen
Created September 19, 2014 10:47
Show Gist options
  • Save pyghassen/b90ff3aa6a50ccb15158 to your computer and use it in GitHub Desktop.
Save pyghassen/b90ff3aa6a50ccb15158 to your computer and use it in GitHub Desktop.
from __future__ import absolute_import
from celery import Celery
app = Celery('my_project',
broker='amqp://',
backend='mongodb://',
include=['tasks'])
# Optional configuration, see the application user guide.
app.conf.update(
CELERY_TASK_SERIALIZER="json",
CELERY_ACCEPT_CONTENT=["json"],
CELERY_RESULT_SERIALIZER='json'
# CELERY_TASK_RESULT_EXPIRES=3600,
# CELERY_MONGODB_BACKEND_SETTINGS={
# "host": "localhost",
# "port": 27017,
# "database": "celery",
# "taskmeta_collection": "my_taskmeta_collection",
# },
)
if __name__ == '__main__':
app.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment