Loading repository data…
Loading repository data…
dj-bolt / repository
Rust-powered API framework for Django achieving 60k+ RPS. Uses Actix Web for HTTP, PyO3 for Python bridging, msgspec for serialization. Decorator-based routing with built-in auth and middleware.
Your first question might be: why? Well, consider this: Faster than FastAPI, but with Django ORM, Django Admin, and Django packages. That’s exactly what this project achieves. Django-Bolt is a high-performance API framework for Django, providing Rust-powered API endpoints capable of 188k+ RPS. Similar to Django REST Framework or Django Ninja, it integrates seamlessly with existing Django projects while leveraging Actix Web for HTTP handling, PyO3 to bridge Python async handlers with Rust's async runtime, and msgspec for fast serialization. You can deploy it directly—no gunicorn or uvicorn needed.
pip install django-bolt
📖 Full Documentation: bolt.farhana.li or if your prefer youtube video by BugBytes
⚠️ Note: Django-Bolt is under active development. Some features are not yet finalized.
# myproject/api.py
from django_bolt import BoltAPI
from django.contrib.auth import get_user_model
import msgspec
User = get_user_model()
api = BoltAPI()
class UserSchema(msgspec.Struct):
id: int
username: str
@api.get("/users/{user_id}")
async def get_user(user_id: int) -> UserSchema: # 🎉 Response is type validated
user = await User.objects.aget(id=user_id) # 🤯 Yes and Django orm works without any setup
return {"id": user.id, "username": user.username} # or you could just return the queryset
# myproject/settings.py
INSTALLED_APPS = [
...
"django_bolt"
...
]
# Start the server in dev mode
python manage.py runbolt --dev
DJANGO_BOLT_MAX_PARAM_LENGTHMaximum allowed size (in bytes) for path/query/form parameter values.
81920 values fall back to 8192export DJANGO_BOLT_MAX_PARAM_LENGTH=65536
Key Features:
📁 Resources: Example project available at python/example/. Run benchmarks with
just save-benchor see scripts/benchmark.sh.
| Endpoint Type | Requests/sec |
|---|---|
| Root endpoint | ~188,100 RPS |
| JSON parsing/validation (10kb) | ~128,400 RPS |
| Path + Query parameters | ~163,200 RPS |
| HTML response | ~164,100 RPS |
| Redirect response | ~96,300 RPS |
| Form data handling | ~143,900 RPS |
| ORM reads (SQLite, 10 records) | ~14,800 RPS |
Server-Sent Events (SSE) with 10,000 concurrent clients (60 Second load time):
Note: Async streaming is recommended for high-concurrency scenarios (10k+ concurrent connections). It has no thread limits and can handle sustained load efficiently.
Why so fast?
# Clone repository
git clone https://github.com/dj-bolt/django-bolt.git
cd django-bolt
# Install dependencies
uv sync
# Build Rust extension
just build # or: maturin develop --release
# Run tests
just test-py
# for linting
just lint-lib
# Build
just build # Build Rust extension
just rebuild # Clean and rebuild
# Testing
just test-py # Run Python tests
# Benchmarking
just save-bench # Run and save results
Contributions welcome! Here's how:
git checkout -b feature/amazing-feature)just test-py)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)Support Django-Bolt's development by becoming a sponsor. Your logo will show up here with a link to your website.
Django-Bolt stands on the shoulders of giants. We're grateful to the following projects and communities that inspired our design and implementation:
Django REST Framework - Our syntax, ViewSet patterns, and permission system are heavily inspired by DRF's elegant API design. The class-based views and guard system follow DRF's philosophy of making common patterns simple.
FastAPI - We drew extensive inspiration from FastAPI's dependency injection system, parameter extraction patterns, and modern Python type hints usage. The codebase structure and async patterns heavily influenced our implementation.
Litestar - Our OpenAPI plugin system is adapted from Litestar's excellent architecture. Many architectural decisions around middleware, guards, and route handling were inspired by Litestar's design philosophy.
Robyn - Robyn's Rust-Python integration patterns and performance-first approach influenced our decision to use PyO3 and showed us the potential of Rust-powered Python web frameworks.
Thank you to all the maintainers, contributors, and communities behind these projects. Django-Bolt wouldn't exist without your incredible work.
Django-Bolt is open source and available under the MIT License.
For questions, issues, or feature requests, please visit our GitHub repository.