Djangors logoDjangors

The Django of Rust.

Everything that makes Django pleasant: the ORM, migrations, the admin, forms, auth, the batteries, the docs, the tutorial. All of it with Rust's speed, safety, and single-binary deploys.

Terminal
$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
$ cargo install djangors-cli
$ dj new mysite && cd mysite
$ cargo run

Compile-time safety

A typo'd field name or a wrong type passed to a query is a build failure, not a bug found in production. The ORM's query builder, model metadata, and form validation are all checked by rustc before the code ships.

Actually fast

No GIL, no GC pauses. Djangors runs on Tokio's async runtime, and it's backed by honest oha-driven HTTP benchmarks against Django/Gunicorn and axum, not marketing numbers.

See the benchmarks →

Secure by default

CSRF protection, security headers, HSTS, a CSP builder, and HttpOnly signed sessions ship enabled out of the box, backed by a real internal security review.

Read the security guide →

Get started

What's included

Frequently asked questions

What is Djangors?

Djangors is a batteries-included web framework for Rust: an ORM with migrations, an auto-generated admin site, forms, authentication, a REST framework, background tasks, payments, and multi-tenancy, all in a single static binary.

Is Djangors "Django for Rust"?

Yes. Djangors brings Django's productivity, its ORM, migrations, admin site, forms, auth, and REST framework, to Rust, while keeping Rust's compile-time safety and performance. The dj CLI mirrors Django's manage.py commands.

Why use Djangors instead of Axum or Actix Web?

Axum and Actix are HTTP frameworks: you still have to choose and integrate an ORM, migrations, an admin panel, auth, and forms yourself. Djangors ships all of that already built, tested, and integrated together, the way Django does for Python, on top of the same hyper/tower foundation.

Is Djangors production-ready?

Djangors is pre-1.0 and under active development, but its core, the ORM, admin, auth, migrations, CLI, REST framework, and background tasks, is built and tested. All 32 crates are published on crates.io, and a real production deployment is already live.

Does Djangors run on Windows, macOS, and Linux?

Yes. Djangors is pure Rust, so it builds and runs anywhere the Rust toolchain does. Install it with cargo install djangors-cli on any of the three.

Is Djangors free and open source?

Yes, dual-licensed under MIT OR Apache-2.0, the standard choice for Rust projects.

Logging

Djangors uses the standard Rust tracing ecosystem, with two ready-made entry points in djangors-core::logging:

  • init_dev_logging(): compact, colored console output; call it first thing in main() during development. Respects the standard RUST_LOG environment variable (e.g. RUST_LOG=debug or RUST_LOG=djangors_core=trace), defaulting to info,djangors_core=debug.
  • init_production_logging(): structured JSON output instead of colored text, ready to pipe into a log aggregator (Elasticsearch, CloudWatch, Datadog). Same RUST_LOG support, defaulting to info,djangors_core=info.

Since both are built on tracing, any tracing-instrumented code, including this framework's own middleware, shows up automatically once one of them is initialized. It's the closest Djangors equivalent to Django's default runserver request-logging line.

djangors_core::logging::init_dev_logging();

Documentation

The full docs site (tutorial, topic guides, the Django-comparison guide, how-tos) lives under docs/src/ and builds with mdBook:

cargo install mdbook
mdbook build docs
mdbook serve docs   # live-reloading local preview

Every Rust code block in the docs is compiled as part of cargo test --workspace (see tools/doc-code-check), so the examples you read are guaranteed to actually work against this exact codebase, not just look plausible.

Roadmap

See PLAN.md for the full 10-phase plan, what's done, and what's left before 1.0.

License

Dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE for the full license texts.

What is this?

Django made building web applications feel obvious: models describe your data, the admin gives you a working back office for free, manage.py handles the busywork, and the framework has an answer for everything from sessions to CSRF to internationalization. Djangors brings that exact experience to Rust. It's batteries included, not a thin HTTP toolkit you have to assemble yourself, and it also gets the wins Rust is actually good at: no null-pointer/type-confusion bugs reaching production, no GC pauses, and a cargo build --release that produces one static binary you can just copy to a server and run.

It's built for the workloads Django gets nervous about at scale: banking backends, school management systems, high-traffic e-commerce. The kind of system where "it usually works" isn't good enough.

Status: pre-1.0, under active development. The core (ORM, admin, auth, migrations, CLI, contrib batteries, a REST framework, real-time/SSE, background tasks, payments, multi-tenancy) is built and tested; see PLAN.md for the full phase-by-phase roadmap and what's done vs. remaining. All 32 crates are published on crates.io at 0.6.2, including the full contrib battery: PDF generation, deployment, payments, multi-tenancy, sitemaps, RSS/Atom syndication, flat pages, redirects, flash messages, object-level permissions, TOTP/2FA, and content types / generic FKs.

Why Rust instead of Python for this?

What's included

Djangors is a Cargo workspace of focused crates, mirroring how Django itself is one framework made of composable pieces:

Crate What it does
djangors-core The HTTP kernel: Request/Response, the Router, middleware (CSRF, security headers, HSTS, CSP builder, host validation), sessions-adjacent state, SSE streaming, signals (framework + model lifecycle), real multipart/form-data file upload parsing, graceful shutdown, optional Sentry error tracking
djangors-orm The ORM: QuerySet, filter/order/aggregate expressions, model metadata, bulk_create, idempotent get_or_create/update_or_create, Postgres full-text search, EXPLAIN, and scalar DB function expressions (COALESCE/LOWER/UPPER/CONCAT/LENGTH)
djangors-macros #[derive(Model)] (also generates a ModelForm equivalent), #[derive(Settings)] (typed, validated app config), #[task], and #[management_command] attribute macros; auto_now/auto_now_add timestamps, field choices (with DB CHECK constraints), and UUID/Date/Decimal support
djangors-db Connection pooling and config-driven database setup (Postgres)
djangors-migrations Schema migrations with real per-file history and rollback (dj migrate --rollback)
djangors-auth Users, groups, permissions, session-backed auth, password hashing, rate-limited login, persistent account lockout
djangors-sessions Signed-cookie session engine
djangors-admin The auto-generated admin site: changelist, filters, search, bulk actions, inline editing, CSV export, audit log, object history, FK inlines, and optional tenant scoping
djangors-forms Form field types and validation, plus the ModelForm equivalent auto-derived from #[derive(Model)]
djangors-views Server-rendered generic class-based views: ListView/DetailView/CreateView/UpdateView/DeleteView
djangors-template A Django-template-flavored engine (minijinja-backed) with Django-style filters
djangors-rest A DRF-equivalent: generic serialization, ViewSets (scoped with config via scoped_viewset_routes_with_config), token/JWT auth, permission classes, cursor pagination, rate limiting, OpenAPI 3.1 generation, and a request.user() convenience accessor
djangors-cache Cache trait + in-memory/database/Redis backends
djangors-mail Email messages with SMTP/file/in-memory backends
djangors-tasks A background task queue (#[task], Postgres SELECT ... FOR UPDATE SKIP LOCKED, cron-style recurring jobs, a worker loop)
djangors-pdf Typed PDF generation for report cards, invoices, and receipts: headings, text, and tables with automatic page breaks
djangors-i18n Runtime internationalization (Fluent-backed catalogs, locale fallback chain)
djangors-staticfiles Static file collection and serving, a pluggable Storage trait (local disk, S3), optional malware/AV scanning of uploaded bytes via clamd
djangors-test In-process test client, real per-test database isolation, and a JSON fixtures loader
djangors-cli (dj) The manage.py equivalent: new, run, migrate (with rollback), createsuperuser, shell (a real evcxr Rust REPL), dbshell, test, check --deploy, and a plugin mechanism for a project's own dj <custom-command>
djangors-deploy DeployProvider trait for dj deploy. Ships a Render provider (real REST API) and an SSH/VPS provider (shells out to the system ssh); Railway/GCP/AWS not yet implemented
djangors-contrib-payments Payment provider integration (Paystack) with idempotent, DB-constraint-backed transaction recording; amounts always in integer minor units, never a float
djangors-contrib-tenancy Multi-tenancy: a Tenant model, membership-verified per-request tenant resolution, and a one-line Scoped helper for real cross-tenant row isolation
djangors-contrib-* Sitemaps, RSS/Atom syndication, flat pages, redirects, flash messages, object-level permissions (guardian-style), TOTP/2FA, content types / generic foreign keys

Two full example apps exercise the framework end-to-end: examples/polls (the tutorial app, mirrors Django's own polls tutorial) and examples/school (an admin-heavy example proving the generic admin alone is enough to build a real CRUD app).