Registry / web-framework / flask-celeryext

flask-celeryext

JSON →
library0.5.0pypypi✓ verified 88d ago

Flask-CeleryExt provides a simple integration layer between Celery and Flask, offering a Flask extension for configuring Celery applications. Current version is 0.5.0 (requires Python >=3.6), with a maintenance-level release cadence.

pip install flask-celeryext
INSTALL
IMPORT
SIG · FLASK-CELERYEXT
F
flask-celeryext
web-frameworkpythonv0.5.0
Install
4.1s avg
Import
722ms
Disk
42MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v0.5.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.738s · 44.6MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 4.1s · import 0.706s · 45MB
42MB installed
● package 42MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FlaskCeleryExt
✓ from flask_celeryext import FlaskCeleryExt
Correct import path
create_celery_app
✓ from flask_celeryext import create_celery_app
Helper function to create Celery app

Minimal Flask app with Celery task using Flask-CeleryExt.

from flask import Flask from flask_celeryext import FlaskCeleryExt app = Flask(__name__) app.config['CELERY_BROKER_URL'] = 'redis://localhost:6379/0' app.config['CELERY_RESULT_BACKEND'] = 'redis://localhost:6379/0' ext = FlaskCeleryExt(app) celery = ext.celery @celery.task def add(x, y): return x + y if __name__ == '__main__': app.run()
Debug
Known issues
gotchaFlask-CeleryExt expects Celery configuration keys like 'CELERY_BROKER_URL' (uppercase with CELERY_ prefix). Using lowercase or missing prefix will silently default to localhost.
fix
Set config keys with 'CELERY_' prefix, e.g., app.config['CELERY_BROKER_URL'] = '...'.
affects: all
deprecatedThe 'BROKER_URL' configuration key (without CELERY_ prefix) is deprecated as of v0.4.2. Use 'CELERY_BROKER_URL' instead.
fix
Replace app.config['BROKER_URL'] with app.config['CELERY_BROKER_URL'].
affects: >=0.4.2
gotchaFlask-CeleryExt does not automatically handle Flask application context for Celery tasks. You must use the @celery.task decorator within an application context or use the create_celery_app helper to avoid context issues.
fix
Use the provided 'create_celery_app' function or ensure tasks are defined after the extension is initialized with the app.
affects: all
Errors
Common errors & fixes
AttributeError: module 'flask_celeryext' has no attribute 'create_celery_app'
Importing directly from 'flask_celeryext' without upgrading to a version that includes create_celery_app (added in 0.4.0).
fix
Upgrade to flask-celeryext>=0.4.0: pip install --upgrade flask-celeryext
celery.exceptions.ImproperlyConfigured: No broker configured
Forgetting to set 'CELERY_BROKER_URL' in Flask app config, or setting it with wrong key name.
fix
Ensure app.config['CELERY_BROKER_URL'] is set to a valid broker URL (e.g., 'redis://localhost:6379/0')
RuntimeError: Working outside of application context
Using Celery tasks outside of Flask application context without proper setup.
fix
Initialize Celery using FlaskCeleryExt(app) or use 'with app.app_context():' when executing tasks outside request context.
Upgrade
Version history
0.5.0latest on PyPI · released Jan 24, 2023
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
30
OpenAI (training)
1
Resources
flask-celeryext — pip install flask-celeryext · libregistry