https://github.com/pallets-eco/flask-rq
RQ (Redis Queue) integration for Flask and Quart applications.
https://github.com/pallets-eco/flask-rq
flask python redis rq
Last synced: 6 days ago
JSON representation
RQ (Redis Queue) integration for Flask and Quart applications.
- Host: GitHub
- URL: https://github.com/pallets-eco/flask-rq
- Owner: pallets-eco
- License: mit
- Created: 2012-07-17T05:19:01.000Z (over 13 years ago)
- Default Branch: main
- Last Pushed: 2025-06-14T20:36:50.000Z (6 months ago)
- Last Synced: 2025-11-05T11:03:44.155Z (about 2 months ago)
- Topics: flask, python, redis, rq
- Language: Python
- Homepage: https://flask-rq.readthedocs.io
- Size: 307 KB
- Stars: 229
- Watchers: 6
- Forks: 36
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-flask - Flask-RQ - [RQ](https://python-rq.org/) (Redis Queue) integration. (Third-Party Extensions / Task Queues)
- jimsghstars - pallets-eco/flask-rq - RQ (Redis Queue) integration for Flask applications (Python)
README
# Flask-RQ
Flask-RQ is a [Flask]/[Quart] extension that background job execution using
[RQ]. RQ allows queueing functions to be run in separate worker processes,
allowing long-running jobs to run in the background without blocking the web app
from returning a response quickly. Flask-RQ allows configuring RQ using Flask's
config, and handles executing jobs in the application context, so other services
like database connections are available.
[Flask]: https://flask.palletsprojects.com
[Quart]: https://quart.palletsprojects.com
[RQ]: https://python-rq.org
## Pallets Community Ecosystem
> [!IMPORTANT]\
> This project is part of the Pallets Community Ecosystem. Pallets is the open
> source organization that maintains Flask; Pallets-Eco enables community
> maintenance of related projects. If you are interested in helping maintain
> this project, please reach out on [the Pallets Discord server][discord].
[discord]: https://discord.gg/pallets
## Installation
Install from [PyPI]:
```
$ pip install flask-rq
```
[PyPI]: https://pypi.org/project/Flask-RQ/
## Example
```python
from flask import Flask, g
from flask_rq import RQ
app = Flask(__name__)
rq = RQ(app)
@rq.job
def send_password_reset_job(user_id: int) -> None:
...
@app.route("/auth/send-password-reset")
def send_password_reset():
send_password_reset_job.enqueue(user_id=g.user.id)
return "Check your email!"
```
```
$ flask rq worker
```