Skip to main content

flask_celery_context

Documentation

The documentation is hosted at https://github.com/BingerYang/flask_celery_context

Installation

pip install flask_celery_context

Usage

example:

# -*- coding: utf-8 -*-
from flask import Flask
from flask_celery import Celery
from flask import request

config = dict(redis={"host": "*****", "port": 31320, "password": "lab@2019"})
redis_url = "redis://:{password}@{host}:{port}".format(**config["redis"])
app = Flask("example.run")
app.config['CELERY_BROKER_URL'] = "{}/1".format(redis_url)
app.config['CELERY_RESULT_BACKEND'] = "{}/2".format(redis_url)
celery = Celery(app)
celery.setup_task_context(lambda: dict(path=request.path))


@celery.task(bind=True)
def add(self, a, b):
    print("a+ n:", a + b, self.request.content)
    return a + b


@app.route("/")
def index():
    ret = add.delay(1, 3)
    print(ret.get())
    return ret.id


if __name__ == "__main__":
    app.run()

Metadata

Release files for flask-celery-context 0.0.1.20040717

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for flask-celery-context 0.0.1.20040717
File Size Uploaded Provenance
flask_celery_context-0.0.1.20040717.tar.gz 4.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for flask-celery-context 0.0.1.20040717
File Interpreter ABI Platform
flask_celery_context-0.0.1.20040717-py3-none-any.whl Python 3 none any Details

Total release size: 9.6 kB

Release files / flask_celery_context-0.0.1.20040717.tar.gz

Download URL flask_celery_context-0.0.1.20040717.tar.gz
Size 4.3 kB
Tags Source
SHA-256 checksum
How to use checksums
451809a70d058c14418abe8f8faa1dcf3f03f6f4ced94e79546133e3bfb553ac
BLAKE2b-256 checksum
How to use checksums
569dd195dad29eca462ee83e88bceb03f0fb9ed88d5601a234ede9dc6d2f62ff
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

Release files / flask_celery_context-0.0.1.20040717-py3-none-any.whl

Download URL flask_celery_context-0.0.1.20040717-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7200670e54c68314cb6ad8b59d89b0586630dc709ef2a9dc1c6f3035eb2dac99
BLAKE2b-256 checksum
How to use checksums
34c248700f360ecad0fe3bcca54627ef85fb7ca4c4de592f862cb4b4b0d31cf9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.8

Security for flask-celery-context 0.0.1.20040717

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page