No project description provided
Project description
Starlette-bugsnag
Bugsnag integration for Starlette ASGI framework.
Installation:
pip install starlette-bugsnag
Usage:
from starlette_bugsnag import BugsnagMiddleware
import bugsnag
bugsnag.configure(...)
app = ...
app = BugsnagMiddleware(app)
Here's a more complete example using Starlette and uvicorn:
import bugsnag
import os
import uvicorn
from starlette_bugsnag import BugsnagMiddleware
from starlette.applications import Starlette
from starlette.responses import PlainTextResponse
bugsnag.configure(api_key=os.getenv('BUGSNAG_API_KEY'), project_root=os.getcwd())
app = Starlette()
app.add_middleware(BugsnagMiddleware, debug=False)
@app.route("/")
def index(request):
return PlainTextResponse("Hello World")
@app.route("/error")
def raiser(request):
raise ValueError("This Is an Error")
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=8000)
See examples for more.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for starlette_bugsnag-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8689ec12a17d7a4ce4fb749cc585bb9d568786f402ef2de744c31b9713a68559 |
|
MD5 | a857d6e7155d401ff653d0c1c33a273c |
|
BLAKE2b-256 | 8de1d80fbb5a12bf5cbf0681b1c4cde04c76d09ca8cc8657ad9f346ef6c8c180 |