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.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be30e2cf695c051e9953ee4bdd37c2dd630574ffc0db8ebf4579ad62a029b09f |
|
MD5 | d4c59d0dc55a267a92a05f7d2ab3c69f |
|
BLAKE2b-256 | 2421baa213f91e92a9c40c41e5f6069907c6b09950a19d9062999632c18ab9f1 |