Skip to content

Latest commit

 

History

History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

dapr.ext.flask

Flask integration for the Dapr Python SDK. Provides DaprApp for pub/sub subscriptions and DaprActor for actor hosting.

pip install "dapr[flask]"
from flask import Flask, request
from dapr.ext.flask import DaprApp

app = Flask('myapp')
dapr_app = DaprApp(app)

@dapr_app.subscribe(pubsub='pubsub', topic='some_topic', route='/some_endpoint')
def my_event_handler():
    # request.data contains the pubsub event
    pass

The legacy top-level flask_dapr import path is still available as a thin shim that emits a FutureWarning. See the root README for migration steps from the legacy flask-dapr distribution.