{% extends "main.html" %} {% block tabs %} {{ super() }}
🚀 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.

Get Started Quickstart →
 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()
    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 render(request, "posts/list.html", {"posts": posts})

Everything Django gave 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. Django requires ATOMIC_REQUESTS or explicit @transaction.atomic decorators to get the same safety.

🔄

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, zero thread overhead.

🛡️

Debug Error Page

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

🗃️

Django-Style ORM

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

🏗️

Built-in Admin Panel

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

📋

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 Django developers already know.

📡

FastAPI Underneath

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

🚀

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 JWT-based session management — 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.


How Buraq stacks up

The best of Django and FastAPI, without the tradeoffs of either.

Feature Django FastAPI Buraq
Async-first ORM ✗ ✗ ✓
Auto transaction rollback on error opt-in ✗ ✓
Django-style ORM API ✓ ✗ ✓
Admin panel ✓ ✗ ✓
ModelForm & validation ✓ ✗ ✓
Class-based views ✓ ✗ ✓
Auto OpenAPI docs ✗ ✓ ✓
Type safety partial ✓ ✓
No sync wrappers needed ✗ ✓ ✓
Built-in debug error page ✓ ✗ ✓
manage.py CLI ✓ ✗ ✓

The ideal application 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. Ship AI-powered apps faster.

🤖

Non-blocking LLM calls

Await OpenAI, Anthropic, or any async AI SDK directly in your views. No sync_to_async() — 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 and model inference endpoints.

🚀

High-concurrency with Granian

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

🗃️

Async storage for AI data

Store chat history, embeddings, user preferences, and model outputs via the async ORM. Works with SQLite (dev), PostgreSQL, and MySQL out of the box.

⚙️

Background AI jobs

Offload slow inference, document indexing, 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 (slowapi) — 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
{% endblock %} {% block content %}{% endblock %} {% block footer %}{{ super() }}{% endblock %}