Skip to main content

django-fast-multipart

PyPI Python Documentation Status

django-fast-multipart is a Rust-backed multipart upload parser for Django. It uses Django's parser extension point while keeping the existing upload handlers, request limits, request.POST, and request.FILES interfaces.

The project currently supports CPython 3.12 or later and Django 6.1.

Installation

python -m pip install django-fast-multipart

Prebuilt wheels are available for Linux x86-64 and ARM64, macOS Intel and Apple Silicon, and Windows x86-64. Other platforms can build from the source distribution with a Rust toolchain.

Quick start

For application-wide use, add the middleware before CSRF or anything else that reads request.POST or request.FILES:

MIDDLEWARE = [
    "django_fast_multipart.middleware.FastMultipartMiddleware",
    "django.middleware.csrf.CsrfViewMiddleware",
    # Other middleware...
]

Your views continue to use Django's normal request API:

def upload(request):
    description = request.POST.get("description", "")
    uploaded_file = request.FILES["file"]
    # Process the uploaded file.

To select it only for one view:

from django_fast_multipart import RustMultiPartParser


def upload(request):
    request.multipart_parser_class = RustMultiPartParser
    uploaded_file = request.FILES["file"]
    # Process the uploaded file.

The parser must be selected before request data is read. Both synchronous WSGI and asynchronous ASGI request stacks are supported, and non-multipart requests remain unchanged.

Documentation

Read the complete guide at django-fast-multipart.readthedocs.io. It covers installation, middleware ordering, per-view setup, upload handlers, compatibility, performance, troubleshooting, and development.

Quick performance results

In our in-process Django request benchmarks, the Rust parser reduced request parsing time for each tested workload:

WSGI request Django Rust Speedup
100 form fields 1.55 ms 0.823 ms 1.89x
Mixed form with a 1 MiB file 1.05 ms 0.679 ms 1.55x
8 MiB temporary file 5.97 ms 4.78 ms 1.25x

The main point is simple: forms with many fields get the biggest benefit. Large uploads also improve, but file writes and Django's upload handlers take most of the time. Memory usage was broadly comparable with Django's parser.

These results are from one GitHub Actions run on Python 3.14 and Django 6.1. They measure an in-process request, not a production server or network. Read the performance guide and benchmark methodology before using the numbers for capacity planning.

Compatibility

The project is currently beta. Its behavior is extensively tested against Django's MultiPartParser, including built-in upload handlers, upload limits, WSGI and ASGI integration, and cleanup after exceptions. Production feedback for custom upload handlers is welcome.

Development

uv sync
uv run pytest
uv run ruff check .
uv run ruff format --check .
cargo fmt --manifest-path rust/Cargo.toml --check
cargo clippy --manifest-path rust/Cargo.toml --locked --all-targets --all-features -- -D warnings
uv build

See the development documentation and release guide for more details.

License

The project is licensed under MIT. See THIRD_PARTY_NOTICES.md for the native parser's upstream attribution and licensing details.

Metadata

Release files for django-fast-multipart 0.1.2

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

Source distribution (sdist)

Source distribution for django-fast-multipart 0.1.2
File Size Uploaded
django_fast_multipart-0.1.2.tar.gz 15.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for django-fast-multipart 0.1.2
File
django_fast_multipart-0.1.2-cp312-abi3-win_amd64.whl CPython 3.12 abi3 Windows x86-64 Details
django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 abi3 Linux glibc 2.17+ x86-64 Details
django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.12 abi3 Linux glibc 2.17+ ARM64 Details
django_fast_multipart-0.1.2-cp312-abi3-macosx_11_0_arm64.whl CPython 3.12 abi3 macOS 11.0+ ARM64 Details
django_fast_multipart-0.1.2-cp312-abi3-macosx_10_12_x86_64.whl CPython 3.12 abi3 macOS 10.12+ x86-64 Details

Total release size: 1.2 MB

Release files / django_fast_multipart-0.1.2.tar.gz

Download URL django_fast_multipart-0.1.2.tar.gz
Size 15.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1256599d247a1cddbe5228ed373b5f7552ba4d1f5864060f7f93d459e161b1ca
BLAKE2b-256 checksum
How to use checksums
224f7d48b99189aaa864f2afd5a519fb8913d0ca82913b3dc7431147c52368ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / django_fast_multipart-0.1.2-cp312-abi3-win_amd64.whl

Download URL django_fast_multipart-0.1.2-cp312-abi3-win_amd64.whl
Size 161.3 kB
Tags CPython 3.12 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3124a6c4dcc3cc4fa6c207232e8c5b47a1658d7bdd6c2c737181d0515c7648e7
BLAKE2b-256 checksum
How to use checksums
24a142cfcdcdba461f2162398462ffe69952267ba052453b719bd19247eb57bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 276.6 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
03b67fe746bc3fcc96ebb835ea3edd0d81c3023dc660d788628fa3b587b259b1
BLAKE2b-256 checksum
How to use checksums
b57a02c440f28b3b66cd119160a05a4fb6c3fabc3c3a6a3dfe7c8eba804d04c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL django_fast_multipart-0.1.2-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 270.1 kB
Tags CPython 3.12 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
3affe2f9ece4c7efba4181a9df1e0fac8cf4d89182c33ca1404e60cb8f005c15
BLAKE2b-256 checksum
How to use checksums
9c5d462e32fa2cca47800c3c5ad4091c75362b74cf63ea302027e55b3eafcf94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / django_fast_multipart-0.1.2-cp312-abi3-macosx_11_0_arm64.whl

Download URL django_fast_multipart-0.1.2-cp312-abi3-macosx_11_0_arm64.whl
Size 248.1 kB
Tags CPython 3.12 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1c14c0f2257fd02afca635f783c57a5dadd833961bd76e499a4e6f18b6c4696d
BLAKE2b-256 checksum
How to use checksums
a3137b2c79d9d446ad27126c8d4c682910f6e30aa463e08c1e0b5ed0340208a6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release files / django_fast_multipart-0.1.2-cp312-abi3-macosx_10_12_x86_64.whl

Download URL django_fast_multipart-0.1.2-cp312-abi3-macosx_10_12_x86_64.whl
Size 261.7 kB
Tags CPython 3.12 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
34013163f117006e4a73127d4538fedc1890483562292bdf61ab2d8f6450343c
BLAKE2b-256 checksum
How to use checksums
41c2fbede49f86a9a9f0d0f77cedc8f27a73ad928563fd2ce612b2d2b0cb3611
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 28, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.2 This release

6 release files

0.1.1

6 release files

0.1.0

6 release files

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