Skip to content

Django-Bolt

Faster than FastAPI. Still Django.

A Rust server runs your typed async handlers. Your models, Admin and middleware keep working. 311,000 requests a second, measured.

pip install django-bolt
311krequests / second, JSON hello-world
0Python before your handler: routing, auth, CORS, rate limits run in Rust
1command: runbolt replaces gunicorn, uvicorn and the process manager

311k measured with 8 processes, C=100, Ryzen 5 5600G, loopback. See Benchmarks for conditions and how to reproduce.

Your first endpoint

api.py
from django_bolt import BoltAPI

api = BoltAPI()

@api.get("/users/{user_id}")
async def get_user(user_id: int):
    return {"user_id": user_id}
python manage.py runbolt --dev

Add django_bolt to INSTALLED_APPS, run the command above, and open http://localhost:8000/docs for interactive API docs. Follow the Quick Start for the full walkthrough.

Why Django-Bolt

Rust speed, Python code

Actix Web and Tokio serve every request. Auth, guards, CORS, rate limiting and compression run in Rust before the GIL.

Typed validation

Parameters and bodies are validated from type hints with msgspec. One msgspec.Struct gives you validation, serialization and OpenAPI.

All of Django

Return a QuerySet and it is evaluated and serialized for you. Models, migrations, signals, sessions and third-party apps work unchanged.

Authentication built in

JWT, API key and session auth, with guards such as IsAuthenticated and Requires. Evaluated natively in Rust.

OpenAPI by default

Swagger UI, Redoc, Scalar, RapiDoc and Stoplight Elements are served at /docs. Schema comes from your type hints.

Streaming, WebSocket, MCP

Server-Sent Events, WebSocket handlers, ASGI mounts and an MCP server for LLM clients via bolt-mcp.

More examples

import msgspec

class CreateUser(msgspec.Struct):
    username: str
    email: str

@api.post("/users")
async def create_user(user: CreateUser):
    return {"username": user.username}
from myapp.models import User

@api.get("/users")
async def list_users():
    return User.objects.all()[:20]
from django_bolt.auth import JWTAuthentication, IsAuthenticated

@api.get("/profile", auth=[JWTAuthentication()], guards=[IsAuthenticated()])
async def profile(request):
    return {"user_id": request.user.id}
from bolt_mcp import MCP

mcp = MCP("my-server")

@mcp.tool
async def add(a: int, b: int) -> dict:
    return {"sum": a + b}

api.mount_mcp(mcp)

Where to go next