Buraq
A high-performance, batteries-included Python web framework — built for AI applications, high-traffic APIs, and developers who know Django.
Buraq delivers Rust-powered performance at every layer — Granian ASGI server, orjson, asyncpg, uv — with a complete full-stack framework: ORM, admin, forms, auth, migrations, templates, signals, cache, and email. All async, all fast.
If you know Django, you already know Buraq. Same views, same URLs, same templates, same ORM patterns — just add await. Built on FastAPI and SQLAlchemy 2.0 under the hood, so you get auto-generated API docs, Pydantic validation, and Rust-level performance out of the box.
Why Buraq?
Modern applications — especially AI backends, LLM APIs, and real-time services — need a framework that handles thousands of concurrent requests without blocking. They also need the full stack: ORM, auth, admin, migrations, cache, and email — not just a router.
At the same time, Python web developers coming from Django shouldn't have to give up familiar patterns just to get async performance. Switching to a low-level async framework means losing everything Django provides out of the box.
Buraq solves both problems. A complete, batteries-included web framework with Rust-powered performance at every layer — and zero re-learning curve for Django developers.
Django Developers: Migrate in Minutes
Buraq is intentionally designed to mirror Django's API. Your existing knowledge transfers directly.
| Django | Buraq |
|---|---|
from django.urls import path |
from buraq.urls import path |
from django.shortcuts import render, redirect |
from buraq.shortcuts import render, redirect |
from django.views.generic import ListView |
from buraq.views.generic import ListView |
from django import forms |
from buraq.forms import ModelForm |
from django.db import models |
from buraq import models |
from django.contrib.auth.decorators import login_required |
from buraq.decorators import login_required |
from django.contrib import messages |
from buraq.contrib.messages import success, error |
python manage.py runserver |
buraq runserver |
python manage.py makemigrations |
buraq makemigrations |
python manage.py migrate |
buraq migrate |
python manage.py startapp |
buraq startapp |
python manage.py createsuperuser |
buraq createsuperuser |
python manage.py collectstatic |
buraq collectstatic |
The only difference: add async/await to your views and ORM calls.
# Django
def post_list(request):
posts = Post.objects.filter(published=True).order_by("-created_at")
return render(request, "posts/list.html", {"posts": posts})
# Buraq — same pattern, truly async
async def post_list(request):
posts = await Post.objects.filter(published=True).order_by("-created_at")
return render(request, "posts/list.html", {"posts": posts})
Quick Start
pip install buraq
buraq startproject myproject
cd myproject
buraq migrate
buraq runserver
Visit http://127.0.0.1:8000 — your project is running.
Visit http://127.0.0.1:8000/api/docs — Swagger UI, auto-generated.
Everything Included
ORM & Database
from buraq import models
class Post(models.Model):
title = models.CharField(max_length=200)
slug = models.SlugField(unique=True)
content = models.TextField()
is_published = models.BooleanField(default=False)
created_at = models.DateTimeField(auto_now_add=True)
author = models.ForeignKey("auth.User", on_delete=models.CASCADE)
buraq makemigrations
buraq migrate
URLs
from buraq.urls import path, include
urlpatterns = [
path("/posts", views.PostListView.as_view(), name="post_list"),
path("/posts/new", views.PostCreateView.as_view(), name="post_create"),
path("/posts/<int:pk>", views.PostDetailView.as_view(), name="post_detail"),
path("/api", include("myapp.api_urls")),
]
Class-Based Views
from buraq.views.generic import ListView, DetailView, CreateView, UpdateView, DeleteView
class PostListView(ListView):
model = Post
template_name = "posts/list.html"
paginate_by = 10
class PostCreateView(CreateView):
model = Post
form_class = PostForm
template_name = "posts/form.html"
success_url = "/posts"
Function-Based Views
from buraq.shortcuts import render, redirect, get_object_or_404
from buraq.contrib.messages import success
from buraq.decorators import login_required
@login_required
async def post_create(request):
form = PostForm(await request.form())
if form.is_valid():
await form.save()
success(request, "Post created successfully.")
return redirect("/posts")
return render(request, "posts/form.html", {"form": form})
Forms & ModelForm
from buraq.forms import ModelForm, CharField, BooleanField
class PostForm(ModelForm):
class Meta:
model = Post
fields = ["title", "slug", "content", "is_published"]
Templates (Jinja2)
{% extends "base.html" %}
{% block content %}
{% for post in posts %}
<h2><a href="/posts/{{ post.id }}">{{ post.title }}</a></h2>
{% endfor %}
{% if messages %}
{% for message in messages %}
<div class="alert">{{ message }}</div>
{% endfor %}
{% endif %}
{% endblock %}
Authentication
from buraq.contrib.auth import authenticate, login, logout
from buraq.decorators import login_required
async def login_view(request):
user = await authenticate(request, username=username, password=password)
if user:
await login(request, user)
return redirect("/dashboard")
Signals
from buraq.signals import post_save
@post_save.connect(sender=Post)
async def on_post_saved(sender, instance, created, **kwargs):
if created:
await notify_subscribers(instance)
Cache
from buraq.contrib.cache import cache
await cache.set("key", value, timeout=300)
value = await cache.get("key")
from buraq.contrib.email import send_mail
await send_mail(
subject="Welcome to Buraq",
message="Thanks for signing up.",
to=["user@example.com"],
)
Performance
Buraq is built on the fastest available Python components at every layer:
| Layer | Library | Benefit |
|---|---|---|
| ASGI server | Granian (Rust) | Faster than uvicorn on all platforms |
| Web framework | FastAPI | ASGI-native, Pydantic v2 |
| Database driver | asyncpg | Fastest async PostgreSQL driver |
| ORM | SQLAlchemy 2.0 | Native async, no sync wrapper |
| JSON | orjson (Rust) | 3–10× faster than stdlib json |
| Password hashing | Argon2id | PHC winner — memory-hard, fast to verify |
| Package manager | uv (Rust) | 10–100× faster than pip |
Features at a Glance
- Async ORM with SQLAlchemy 2.0 —
await Model.objects.filter(...) - Alembic migrations —
buraq makemigrations/buraq migrate path()URL routing with type-safe converters- Class-based views — ListView, DetailView, CreateView, UpdateView, DeleteView
- ModelForm with field validation and
await form.save() - Jinja2 templates with Django-compatible template tags
- Built-in auth — JWT + session, login/register/logout
- Auto admin panel via SQLAdmin —
buraq createsuperuser - Flash messages backed by session storage
- Signals —
post_save,pre_delete, custom signals - Cache backends — Redis, Memcached, in-memory (all async)
- Email backends — SMTP, console, file (all async)
- Static files — WhiteNoise +
buraq collectstatic - Rate limiting via SlowAPI
- Security headers via the
securepackage - CORS middleware
- orjson for all JSON responses
- Granian ASGI server built-in, falls back to uvicorn
- Auto API docs — Swagger UI and ReDoc at
/api/docs
Documentation
Full documentation: buraqproject.com/docs/1.0
Contributing
See CONTRIBUTING.md — contributions are welcome.
Changelog
See CHANGELOG.md.
License
MIT — see LICENSE
Release files for buraq 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| buraq-1.2.0.tar.gz | 252.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| buraq-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size:338.7 kB
Release files / buraq-1.2.0.tar.gz
| Download URL | buraq-1.2.0.tar.gz |
|---|---|
| Size | 252.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0f87ea112104c8bf90b02a34314289d0b81993abc7c918ad58e3ef22d4b4a9d1
|
|
BLAKE2b-256 checksum How to use checksums |
23bb27ea2f57c5b5209f9d08c72355bbddea6b50ec13308ff75aa0dbafeb2ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / buraq-1.2.0-py3-none-any.whl
| Download URL | buraq-1.2.0-py3-none-any.whl |
|---|---|
| Size | 86.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
272cde920c1f5afcb59e913b3196a1a2efd2a134b069f9ec31f6089d925861c3
|
|
BLAKE2b-256 checksum How to use checksums |
ea8fb29684b59280f84748caf1f797fa2c872e65860f2dd1d28f35c67d6a7a25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|