{"id":45136660,"url":"https://github.com/dj-bolt/django-bolt","last_synced_at":"2026-03-07T03:05:11.965Z","repository":{"id":315800980,"uuid":"1060871652","full_name":"dj-bolt/django-bolt","owner":"dj-bolt","description":"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.","archived":false,"fork":false,"pushed_at":"2026-03-02T19:15:23.000Z","size":22536,"stargazers_count":1184,"open_issues_count":11,"forks_count":56,"subscribers_count":23,"default_branch":"master","last_synced_at":"2026-03-02T20:05:18.804Z","etag":null,"topics":["actix-web","api","api-rest","asyncio","bolt","django","django-bolt","msgspec","pyo3","python","rust"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dj-bolt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"Agents.md","dco":null,"cla":null}},"created_at":"2025-09-20T19:04:44.000Z","updated_at":"2026-03-02T19:15:24.000Z","dependencies_parsed_at":"2025-09-20T21:11:43.153Z","dependency_job_id":"f642d2f9-13df-462b-bb62-b8075b5fbbfa","html_url":"https://github.com/dj-bolt/django-bolt","commit_stats":null,"previous_names":["farhanaliraza/django-bolt","dj-bolt/django-bolt"],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/dj-bolt/django-bolt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dj-bolt%2Fdjango-bolt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dj-bolt%2Fdjango-bolt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dj-bolt%2Fdjango-bolt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dj-bolt%2Fdjango-bolt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dj-bolt","download_url":"https://codeload.github.com/dj-bolt/django-bolt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dj-bolt%2Fdjango-bolt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30092862,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T20:42:30.420Z","status":"ssl_error","status_checked_at":"2026-03-04T20:42:30.057Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actix-web","api","api-rest","asyncio","bolt","django","django-bolt","msgspec","pyo3","python","rust"],"created_at":"2026-02-20T00:00:36.125Z","updated_at":"2026-03-07T03:05:11.931Z","avatar_url":"https://github.com/dj-bolt.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/logo.png\" alt=\"Django-Bolt Logo\" width=\"400\"/\u003e\n\u003c/div\u003e\n\n[![PyPI version](https://img.shields.io/pypi/v/django-bolt.svg)](https://pypi.org/project/django-bolt/)\n[![PyPI Downloads](https://static.pepy.tech/personalized-badge/django-bolt?period=total\u0026units=INTERNATIONAL_SYSTEM\u0026left_color=BLACK\u0026right_color=GREEN\u0026left_text=downloads)](https://pepy.tech/projects/django-bolt)\n[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/FarhanAliRaza/django-bolt)\n[![Sponsor](https://img.shields.io/badge/Sponsor-Django%20Bolt-pink)](https://opencollective.com/django-bolt)\n\n# High-Performance Fully Typed API Framework for Django\n\nYour 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 60k+ 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.\n\n## 🚀 Quick Start\n\n### Installation 🎉\n\n```bash\npip install django-bolt\n```\n\n**📖 Full Documentation:** [bolt.farhana.li](https://bolt.farhana.li/) or if your prefer [youtube video by BugBytes](https://www.youtube.com/watch?v=Pukr-fT4MFY)\n\n\u003e ⚠️ **Note:** Django-Bolt is under active development. Some features are not yet finalized.\n\n### Run Your First API\n\n```python\n# myproject/api.py\nfrom django_bolt import BoltAPI\nfrom django.contrib.auth import get_user_model\nimport msgspec\n\nUser = get_user_model()\n\napi = BoltAPI()\n\nclass UserSchema(msgspec.Struct):\n    id: int\n    username: str\n\n\n@api.get(\"/users/{user_id}\")\nasync def get_user(user_id: int) -\u003e UserSchema: # 🎉 Response is type validated\n    user = await User.objects.aget(id=user_id) # 🤯 Yes and Django orm works without any setup\n    return {\"id\": user.id, \"username\": user.username} # or you could just return the queryset\n\n```\n\n```python\n# myproject/settings.py\nINSTALLED_APPS = [\n    ...\n    \"django_bolt\"\n    ...\n]\n```\n\n```bash\n# Start the server in dev mode\npython manage.py runbolt --dev\n```\n\n---\n\n**Key Features:**\n\n- 🚀 **High Performance** - Rust-powered HTTP server (Actix Web + Tokio + PyO3)\n- 🔐 **[Authentication](https://bolt.farhana.li/topics/authentication/)** - JWT/API Key validation in Rust without Python GIL\n- 🔒 **[Permissions \u0026 Guards](https://bolt.farhana.li/topics/permissions/)** - Route protection with IsAuthenticated, HasPermission, etc.\n- 🎛️ **[Middleware](https://bolt.farhana.li/topics/middleware/)** - CORS, rate limiting, compression, Django middleware integration\n- 📦 **[Serializers](https://bolt.farhana.li/topics/serializers/)** - msgspec-based validation (5-10x faster than stdlib)\n- 🎯 **[Django ORM](https://bolt.farhana.li/topics/async-orm/)** - Full async ORM support with your existing models\n- 📡 **[Responses](https://bolt.farhana.li/topics/responses/)** - JSON, HTML, streaming, SSE, file downloads\n- 📚 **[OpenAPI](https://bolt.farhana.li/topics/openapi/)** - Auto-generated docs (Swagger, ReDoc, Scalar, RapidDoc)\n- 🎨 **[Class-Based Views](https://bolt.farhana.li/topics/class-based-views/)** - ViewSet and ModelViewSet patterns\n- 🧪 **[Testing](https://bolt.farhana.li/topics/testing/)** - Built-in test client for API testing\n\n## 📊 Performance Benchmarks\n\n\n\u003e **📁 Resources:** Example project available at [python/example/](python/example/). Run benchmarks with `just save-bench` or see [scripts/benchmark.sh](scripts/benchmark.sh).\n\n### Standard Endpoints\n\n| Endpoint Type                  | Requests/sec     |\n| ------------------------------ | ---------------- |\n| Root endpoint                  | **~100,000 RPS** |\n| JSON parsing/validation (10kb) | **~83,700 RPS**  |\n| Path + Query parameters        | **~85,300 RPS**  |\n| HTML response                  | **~100,600 RPS** |\n| Redirect response              | **~96,300 RPS**  |\n| Form data handling             | **~76,800 RPS**  |\n| ORM reads (SQLite, 10 records) | **~13,000 RPS**  |\n\n### Streaming Performance (Async)\n\n**Server-Sent Events (SSE) with 10,000 concurrent clients (60 Second load time):**\n\n- **Total Throughput:** 9,489 messages/sec\n- **Successful Connections:** 10,000 (100%)\n- **Avg Messages per Client:** 57.3 messages\n- **Data Transfer:** 14.06 MB across test\n- **CPU Usage:** 11.9% average during test (peak: 101.9%)\n- **Memory Usage:** 236.1 MB\n\n\u003e **Note:** Async streaming is recommended for high-concurrency scenarios (10k+ concurrent connections). It has no thread limits and can handle sustained load efficiently.\n\n**Why so fast?**\n\n- HTTP Parsing and Response is handled by Actix-rs framework (one of the fastest in the world)\n- Request routing uses matchit (zero-copy path matching)\n- JSON serialization with msgspec (5-10x faster than stdlib)\n\n---\n\n## 🔧 Development\n\n### Setup\n\n```bash\n# Clone repository\ngit clone https://github.com/dj-bolt/django-bolt.git\ncd django-bolt\n# Install dependencies\nuv sync\n# Build Rust extension\njust build  # or: maturin develop --release\n# Run tests\njust test-py\n# for linting\njust lint-lib\n```\n\n### Commands\n\n```bash\n# Build\njust build          # Build Rust extension\njust rebuild        # Clean and rebuild\n\n# Testing\njust test-py        # Run Python tests\n\n# Benchmarking\njust save-bench     # Run and save results\n\n```\n\n---\n\n## 🤝 Contributing\n\nContributions welcome! Here's how:\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Run tests (`just test-py`)\n5. Commit (`git commit -m 'Add amazing feature'`)\n6. Push (`git push origin feature/amazing-feature`)\n7. Open a Pull Request\n\n### Areas That Need Help\n\n- Testing and fixing bugs\n- Add extension support (adding lifecycle events, making di comprehensive)\n- Cleaning up code.\n- More examples, tutorials, and docs.\n\n\n\n## 🙏 Acknowledgments \u0026 Inspiration\n\nDjango-Bolt stands on the shoulders of giants. We're grateful to the following projects and communities that inspired our design and implementation:\n\n### Core Inspirations\n\n- **[Django REST Framework](https://github.com/encode/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.\n\n- **[FastAPI](https://github.com/tivy520/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.\n\n- **[Litestar](https://github.com/litestar-org/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.\n\n- **[Robyn](https://github.com/sparckles/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.\n\n### Additional Credits\n\n- **[Actix Web](https://github.com/actix/actix-web)** - The Rust HTTP framework that powers our performance\n- **[PyO3](https://github.com/PyO3/pyo3)** - For making Rust-Python interop seamless\n- **[msgspec](https://github.com/jcrist/msgspec)** - For blazing-fast serialization\n- **[matchit](https://github.com/ibraheemdev/matchit)** - For zero-copy routing\n\nThank you to all the maintainers, contributors, and communities behind these projects. Django-Bolt wouldn't exist without your incredible work.\n\n---\n\n## 📄 License\n\nDjango-Bolt is open source and available under the MIT License.\n\n---\n\nFor questions, issues, or feature requests, please visit our [GitHub repository](https://github.com/FarhanAliRaza/django-bolt).\n","funding_links":["https://opencollective.com/django-bolt"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdj-bolt%2Fdjango-bolt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdj-bolt%2Fdjango-bolt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdj-bolt%2Fdjango-bolt/lists"}