Skip to main content

Rusjango

An experimental async Python API framework with Django-style apps and an optional Rust extension.

Version: 0.1.4. Status: alpha. Phases 1–3 provide routing, app scaffolding, and a basic async ORM. The Rust CLI is implemented; the Rust runtime core is a placeholder and currently provides no routing or serialization acceleration. Auth, admin, OpenAPI, workers, AI helpers, and enterprise features are not implemented.

What works

  • A three-file project: main.py, settings.py, pyproject.toml.
  • Async GET, POST, PUT, and DELETE handlers with JSON responses.
  • Literal paths and typed path/query parameters; invalid input returns 422.
  • Strict schemas with required fields, defaults, optional types, nested schemas, lists, and dictionaries.
  • ASGI middleware, production host validation, and security response headers.
  • Independent application routers under /api/<app>/.
  • SQLite and PostgreSQL CRUD with parameterized values, generated integer IDs, and affected-row counts.
  • Table creation through migrate; existing schema changes require manual SQL.
  • Python CLI included in the package and a separate Rust CLI with embedded templates.

Develop from source

Requires Python 3.11+, Rust, and uv. On Windows, use the Linux environment for all commands below when working in WSL2.

cd /mnt/d/Rusjango  # WSL2 path for D:\Rusjango
uv sync --all-packages --all-extras
cargo build -p rusjango-cli

cd examples/hello
uv run python -m rusjango migrate
uv run python -m rusjango dev

Visit http://127.0.0.1:8000/ or /api/school/students. Migration is an explicit command; server startup never creates or alters tables.

For a published package, install rusjango into a virtual environment, then use:

rusjango new demo
cd demo
uv sync
rusjango add app school
rusjango add orm
rusjango migrate
rusjango dev

A generated project depends on the published package. To exercise unreleased source changes, use the repository example or install this checkout into the generated project's environment. See getting started.

Example API

from rusjango import Rusjango, Schema

app = Rusjango()

class Greeting(Schema):
    name: str
    age: int | None = None

@app.post('/hello')
async def hello(data: Greeting):
    return {'message': f'Hello {data.name}', 'age': data.age}

JSON schema fields use strict types: "20" is not an integer. Extra object keys are ignored. Path and query strings support str, int, float, and bool conversion.

Safe scaffolding

add orm upgrades an API only when it still matches the untouched starter template. Custom routes, models, and schemas are preserved. Apps added after ORM activation receive ORM scaffolding too. Removal asks for confirmation unless --yes is supplied.

The CLI edits literal settings assignments. It preserves unrelated settings, but may normalize the edited list/dictionary and remove comments inside that value. Computed settings should be edited manually. remove orm preserves application code; routes that use the ORM need to be removed or adapted by the developer.

Test and build

uv run --all-packages --all-extras pytest python/rusjango/tests -q
cargo fmt --all -- --check
PYO3_PYTHON="$(pwd)/.venv/bin/python" cargo test --workspace
PYO3_PYTHON="$(pwd)/.venv/bin/python" cargo clippy --workspace --all-targets -- -D warnings
uv run ruff check python/rusjango/src python/rusjango/tests scripts --select F
uv build --package rusjango

To exercise the Rust CLI alongside Python, build it first and set RUSJANGO_RUST_CLI to its absolute binary path. Real PostgreSQL tests require RUSJANGO_TEST_POSTGRES_DSN pointing to a disposable test database. Testing details.

The Phase 1–3 repair pass passed 74 tests on Python 3.11 and 3.14, including both CLIs and live PostgreSQL. Rust checks and clean distribution builds also passed. See the validation record for scope and reproduction steps.

Current limits

One database configuration per process; no multi-database isolation, relationships, transaction API, tracked migrations, auth, admin, OpenAPI generation, streaming, uploads, or supported WebSockets. SQLite requires version 3.35+ for INSERT ... RETURNING. Request bodies are buffered in memory. There are no performance benchmarks proving an advantage over other frameworks.

Existing databases created by the old default-table bug may contain a table named model. The fix does not rename that table or move its data. Back up those databases and migrate data explicitly before adopting corrected model table names.

Documentation

Start with the overview, architecture, CLI reference, API guide, and ORM guide. PROGRESS.md tracks the phase gates.

Additional guides: settings, middleware, schemas, contributing, validation, and release procedure. Release notes explain compatibility changes.

MIT licensed. See LICENSE.

Metadata

Release files for rusjango 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rusjango 0.1.4
File Size Uploaded Provenance Actions
rusjango-0.1.4.tar.gz 29.1 kB Without provenance Details for rusjango-0.1.4.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for rusjango 0.1.4
File Actions
rusjango-0.1.4-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for rusjango-0.1.4-cp311-abi3-win_amd64.whl
rusjango-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for rusjango-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
rusjango-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for rusjango-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
rusjango-0.1.4-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for rusjango-0.1.4-cp311-abi3-macosx_11_0_arm64.whl
rusjango-0.1.4-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for rusjango-0.1.4-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 1.1 MB

Release files / rusjango-0.1.4.tar.gz

Download URL rusjango-0.1.4.tar.gz
Size 29.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f7c9c45cf02e90258ca4174591600d85733a71e2ebefca34f7a71eacbb323060
BLAKE2b-256 checksum
How to use checksums
2489766f2884b1b4be6df1aef66533770fec21dc90e0cc52d734c756fb9705dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / rusjango-0.1.4-cp311-abi3-win_amd64.whl

Download URL rusjango-0.1.4-cp311-abi3-win_amd64.whl
Size 121.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
34015b56e7c698371a38a342c9e5a5f1e1cb873ac4f5500f5b821876e20cd2c9
BLAKE2b-256 checksum
How to use checksums
81ee6e032a798e5e129e1067d548c97c4a2fc3cc7a81dd5f76928525eacee7e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / rusjango-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL rusjango-0.1.4-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 255.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
93c30d7a5a2a61450a7f0399bcabe4bae35b93aef0cfb96d855849587f651da8
BLAKE2b-256 checksum
How to use checksums
daf9b2c2cba2585f57d439e3c5276c710b2e0598249a44dfcdef9afae9fa0f67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / rusjango-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL rusjango-0.1.4-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 248.6 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
82cb35e40318cf62449d4e9ce074bd1b7a447ee6fc0d0c9ffb1907ac91dbbc63
BLAKE2b-256 checksum
How to use checksums
de0cadec85201d6f3c29f90a3b69a713489a1d3158a026c304a7f1a121a7931f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / rusjango-0.1.4-cp311-abi3-macosx_11_0_arm64.whl

Download URL rusjango-0.1.4-cp311-abi3-macosx_11_0_arm64.whl
Size 224.7 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f776d0440b4d322c256df54e0c5cbf6c31ff6bea367ed011bb79ade20c1df43a
BLAKE2b-256 checksum
How to use checksums
b3074818bc1f98257cb1a391fe95679d81cf0a4034198c7f55e0fed373918958
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / rusjango-0.1.4-cp311-abi3-macosx_10_12_x86_64.whl

Download URL rusjango-0.1.4-cp311-abi3-macosx_10_12_x86_64.whl
Size 225.0 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
dffc061afe084cb7d218c991c6795699a66c34b5e55b183f918ca87f28c75cab
BLAKE2b-256 checksum
How to use checksums
359acce8719f7f47d5a776341204f8d17358cf5d2f27889743e49b8ec1e2ebe7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for rusjango 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page