Skip to content

taogeT/flask-celery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flask Celery 3.0+ Integration

Celery: http://celeryproject.org

Using Flask-Celery

You can easily add Celery to your flask application like this:

app.py:

from flask_celery import Celery

celery = Celery()

def create_app():
    app = Flask(__name__)

    celery.init_app(app)

    return app

@celery.task
def add(x, y):
    return x + y

To start the worker you can then launch the celery worker command by pointing to your celery app instance:

$ celery -A app:celery worker -l info

If your flask application has complex condition, you can refer to the example https://github.com/taogeT/flask-celery .

Releases

No releases published

Packages

No packages published

Languages