SDKs JavaScript SDK Python SDK Go SDK Ruby SDK How It Works Features Pricing FAQ Blog
Book a Demo Log In Sign Up

Python SDK

Capture production errors automatically in your Flask, FastAPI, and Django applications.

Installation

$ pip install bugstack

Quick Start: Flask

python
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

Quick Start: FastAPI

python
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

Quick Start: Django

python
# 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
]

Source Code

View the full source code, report issues, and contribute on GitHub.

← Back to Documentation