Capture production errors automatically in your Flask, FastAPI, and Django applications.
pip install bugstack
import os
from flask import Flask
from bugstack import init_bugstack
app = Flask(__name__)
# Initialize bugstack
init_bugstack(api_key=os.environ['BUGSTACK_API_KEY'])
@app.route('/')
def hello():
return 'Hello World'
# bugstack automatically captures unhandled exceptions
import os
from fastapi import FastAPI
from bugstack import init_bugstack
app = FastAPI()
# Initialize bugstack
init_bugstack(api_key=os.environ['BUGSTACK_API_KEY'])
@app.get('/')
async def root():
return {'message': 'Hello World'}
# bugstack automatically captures unhandled exceptions
# settings.py
import os
from bugstack import init_bugstack
# Initialize bugstack in your Django settings
init_bugstack(api_key=os.environ['BUGSTACK_API_KEY'])
# Add bugstack middleware
MIDDLEWARE = [
'bugstack.django.BugStackMiddleware',
# ... your other middleware
]
View the full source code, report issues, and contribute on GitHub.