Skip to content
Async-first · Production-ready

The async Python framework
you already know how to use

Buraq brings Django's developer experience — ORM, admin, forms, CBVs — to the modern async ecosystem, built on FastAPI and SQLAlchemy 2.0.

main.py
from buraq import Buraq
from buraq import models
from buraq.shortcuts import render

app = Buraq(settings_module="config.settings")

class Post(models.Model):
    title        = models.CharField(max_length=200)
    content      = models.TextField()
    is_published = models.BooleanField(default=False)
    created      = models.DateTimeField(auto_now_add=True)

@app.get("/posts/")
async def post_list(request):
    posts = await Post.objects.filter(is_published=True).order_by("-created")
    return await render(request, "posts/list.html", {"posts": posts})
0sync_to_async wrappers
3databases, all async
1command to a running project

Built on foundations you already trust

FastAPI
SQLAlchemy 2.0
Pydantic
Granian
PostgreSQL
MySQL
SQLite
Redis

Why Buraq

Everything a full-stack framework gives you.
Now fully async.

Stop choosing between developer ergonomics and async performance. Buraq gives you both without compromise.

Automatic Transaction Rollback

SQLAlchemy rolls back the entire transaction automatically when an exception occurs mid-request — no partial writes, no corrupt state.

True Async — No Wrappers

Every view, ORM call, form validator, and signal handler is natively async. No sync_to_async(), no asyncio.run() hacks. One event loop.

Debug Error Page

A rich browser-based debug page — source context, local variables per frame, full request headers — shown automatically when DEBUG = True.

Django-Style ORM

Model.objects.filter(), Q objects, F expressions, select_related, signals, and get_or_404 — powered by SQLAlchemy 2.0 async.

Built-in Admin Panel

A full CRUD admin at /admin — list, filter, search, create, edit, delete — bundled inside Buraq. No sqladmin dependency.

ModelForm & Validation

Auto-generate forms from model columns with field-level and cross-field async validation. CSRF protection built in.

Class-Based Views

ListView, DetailView, CreateView, UpdateView, DeleteView — the same CBV patterns developers already know.

FastAPI Underneath

Automatic OpenAPI docs at /api/docs, Pydantic integration, dependency injection, and full Starlette middleware compatibility.

Granian ASGI Server

Ships with Granian — a Rust-based ASGI server that outperforms uvicorn and hypercorn in benchmarks. buraq runserver just works.

Auth & Permissions

Built-in user model, login_required, permission_required, groups, and session-based auth — no extra packages.

i18n & Translations

Django-style internationalization with gettext, translatable model fields, and per-request locale switching.

Full CLI

startproject, startapp, migrate, makemigrations, createsuperuser, collectstatic — everything you expect from a batteries-included framework.

Comparison

How Buraq stacks up

The best of two worlds, without the tradeoffs of either.

FeatureDjangoFastAPIBuraq
True async queries
Auto transaction rollbackopt-in
ORM API
Admin panel
ModelForm & validation
Class-based views
Auto OpenAPI docs
Type safetypartial
No sync wrappers needed
Built-in debug error page
manage.py CLI

Django ships async query methods, but they wrap the synchronous ORM and run on one shared thread —see the measurement.

Architecture

Async that actually runs concurrently

Django's ORM is synchronous. Its async methods wrap the sync implementation, so concurrent queries queue behind one another. Buraq's ORM is async all the way down — concurrency is bounded by your connection pool, not by a shared thread.

Django 5.0async wrapper over sync ORM
# django/db/models/query.py

async def aget(self, *args, **kwargs):
    return await sync_to_async(self.get)(*args, **kwargs)

sync_to_async defaults to thread_sensitive=True, which runs every call on one shared thread.

Buraqnative async, no wrapper
# asyncpg / aiosqlite driver, awaited directly

post = await Post.objects.get(id=1)

Real non-blocking I/O. Thousands of in-flight queries on a single thread, limited only by the pool.

8 concurrent queries, 100 ms each

Django aget()0.81s
True async I/O0.10s

Measured with asgiref.sync_to_async at Django's default settings — the same call path aget() uses. Serialised through one thread versus running concurrently.

AI-Ready

The ideal layer for AI products

Buraq's async-first design means every part of your stack — API calls, database writes, background jobs — runs concurrently without blocking.

Non-blocking LLM calls

Await OpenAI, Anthropic, or any async AI SDK directly in your views. The event loop stays free while the model thinks.

Auto OpenAPI for inference APIs

FastAPI underneath gives you typed request/response schemas and live docs at /api/docs — perfect for AI microservices.

High-concurrency with Granian

Bundled Rust-based ASGI server handles hundreds of concurrent AI requests with lower latency than gunicorn or uvicorn.

Async storage for AI data

Store chat history, embeddings, and model outputs via the async ORM. Works with SQLite, PostgreSQL, and MySQL.

Background AI jobs

Offload slow inference or embedding generation to buraq worker background tasks — results written to the DB when ready.

Auth for AI chat apps

Built-in user sessions, login_required, and rate limiting — everything needed to secure a multi-user AI assistant.

✦ AI streaming endpoint — main.py
from buraq import Buraq
from buraq.contrib.auth.decorators import login_required
from fastapi.responses import StreamingResponse
from anthropic import AsyncAnthropic

app = Buraq(settings_module="config.settings")
llm = AsyncAnthropic()

@app.post("/chat/")
@login_required
async def chat(request):
    body   = await request.json()
    prompt = body["message"]

    async def token_stream():
        async with llm.messages.stream(
            model="claude-opus-5",
            max_tokens=1024,
            messages=[{"role": "user", "content": prompt}],
        ) as stream:
            async for text in stream.text_stream:
                yield text

    return StreamingResponse(token_stream(), media_type="text/plain")

Start building in minutes

One command sets up a full project with database, admin, and auth ready to go.

pip install buraq && buraq startproject myapp