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
File details
Details for the file starlette-bugsnag-0.2.1.tar.gz
.
File metadata
- Download URL: starlette-bugsnag-0.2.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13f653f2d065cb0804605a397dac4c2774ea76d2f2901441a9e442f341eebfbe |
|
MD5 | 77f7f562bcb266b6fc57f481ce1fc767 |
|
BLAKE2b-256 | f23b53e9e57cbba9e51c73594685f0e21ed16da6b368524732950cc0864d2464 |
File details
Details for the file starlette_bugsnag-0.2.1-py3-none-any.whl
.
File metadata
- Download URL: starlette_bugsnag-0.2.1-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | be30e2cf695c051e9953ee4bdd37c2dd630574ffc0db8ebf4579ad62a029b09f |
|
MD5 | d4c59d0dc55a267a92a05f7d2ab3c69f |
|
BLAKE2b-256 | 2421baa213f91e92a9c40c41e5f6069907c6b09950a19d9062999632c18ab9f1 |