Skip to main content

django-litestream

PyPI - Version PyPI - Python Version PyPI - Versions from Framework Classifiers MIT License

Django integration for Litestream, the SQLite replication tool. The Litestream binary is bundled in platform-specific wheels — no manual download needed. All upstream commands are available as python manage.py litestream <command>.

Note: This package tracks Litestream's upstream version. The initial release is 0.5.11, matching Litestream v0.5.11. Wrapper-only fixes (no Litestream update) use PEP 440 post-releases like 0.5.11.post1.

Installation

pip install django-litestream

Add to INSTALLED_APPS:

INSTALLED_APPS = [
    "django_litestream",
]

The binary is installed automatically on supported platforms (Linux/macOS x86_64 & arm64). On unsupported platforms, set a custom path:

LITESTREAM = {
    "bin_path": "/usr/local/bin/litestream",
}

Configuration

Configuration is generated dynamically from Django settings — no YAML file needed.

# settings.py
LITESTREAM = {
    "path_prefix": "",      # prepended to S3 replica paths
    "bin_path": "...",      # custom binary path (optional)
    "dbs": [                # databases to replicate
        {"path": "default"},
    ],
}

All Litestream config options are supported (addr, logging, mcp-addr, access-key-id, etc.).

Database aliases

Use Django database aliases instead of file paths wherever db_path is required:

python manage.py litestream restore default        # instead of /path/to/db.sqlite3
python manage.py litestream sync default

Auto-generated replicas

If no replica is specified for a database, an S3 replica is auto-generated using environment variables:

LITESTREAM = {
    "dbs": [{"path": "default"}],
}
# Uses: LITESTREAM_REPLICA_BUCKET, LITESTREAM_ACCESS_KEY_ID, LITESTREAM_SECRET_ACCESS_KEY

Explicit replica config:

LITESTREAM = {
    "dbs": [
        {
            "path": "default",
            "replica": {
                "type": "s3",
                "bucket": "my-bucket",
                "path": "db.sqlite3",
            },
        },
    ],
}

Multiple databases with path_prefix

DATABASES = {
    "default": {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "db.sqlite3"},
    "cache":  {"ENGINE": "django.db.backends.sqlite3", "NAME": BASE_DIR / "cache.sqlite3"},
}

LITESTREAM = {
    "path_prefix": "myproject",
    "dbs": [
        {"path": "default"},           # → myproject/db.sqlite3
        {
            "path": "cache",
            "replica": {
                "type": "s3",
                "bucket": "my-cache-bucket",
                "path": "cache.sqlite3",
            },
        },
    ],
}

Custom commands

These commands are unique to django-litestream — they don't exist in upstream Litestream.

litestream config

Display the generated configuration in YAML format.

python manage.py litestream config

Useful for verifying your setup before running replication.

litestream verify

Checks backup integrity end-to-end: writes a verification row, waits for replication, restores the latest backup, and confirms the row exists.

python manage.py litestream verify default

Upstream commands

All Litestream commands are exposed as management commands. Run python manage.py litestream to see the full list. Key notes:

  • replicate: Run in production via a process manager. Use -exec to wrap your application server.
  • restore: Supports -timestamp, -generation, -index for point-in-time recovery.
  • Daemon control (info, list, register, unregister, start, stop): Communicate with a running replicate daemon over IPC.

The only difference from upstream is that Django database aliases work anywhere db_path is expected.

VFS Read Replicas

Read-only access to cloud-stored replicas without downloading the entire database. Pages are fetched on-demand.

pip install django-litestream[vfs]

This installs django-litestream, the django-litestream-vfs Django integration, and the upstream litestream-vfs package, which bundles the compiled VFS extension.

Setup

# settings.py
from django_litestream_vfs import get_vfs_databases

LITESTREAM = {
    "dbs": [{"path": "default"}],
    "vfs": {
        "prod_replica": "s3://mybucket/db.sqlite3",
    },
}

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.sqlite3",
        "NAME": BASE_DIR / "db.sqlite3",
    },
    **get_vfs_databases(),  # adds VFS replicas
}

Usage

User.objects.using("prod_replica").all()  # read-only, on-demand page fetch

VFS replicas are read-only. Only x86_64 and arm64 supported. Multiple storage backends supported (S3, GCS, Azure Blob).

Note: the upstream litestream-vfs package currently ships wheels for Python 3.8–3.13. On Python 3.14 the VFS extra will not install until upstream publishes a cp314 wheel.

License

MIT. The bundled Litestream binary uses the Apache 2.0 license.

Metadata

Release files for django-litestream 0.5.17

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-litestream 0.5.17
File Size Uploaded
django_litestream-0.5.17.tar.gz 11.3 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for django-litestream 0.5.17
File
django_litestream-0.5.17-py3-none-win_arm64.whl Python 3 none Windows ARM64 Details
django_litestream-0.5.17-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details
django_litestream-0.5.17-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux musl 1.1+ x86-64 Details
django_litestream-0.5.17-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl Python 3 none Linux musl 1.1+ ARM64, Linux glibc 2.17+ ARM64 Details
django_litestream-0.5.17-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details
django_litestream-0.5.17-py3-none-macosx_10_9_x86_64.whl Python 3 none macOS 10.9+ x86-64 Details
django_litestream-0.5.17-py3-none-any.whl Python 3 none any Details

Total release size: 229.6 MB

Release files / django_litestream-0.5.17.tar.gz

Download URL django_litestream-0.5.17.tar.gz
Size 11.3 kB
Tags Source
SHA-256 checksum
How to use checksums
ebec4590d3a8d0e7c4e6080ef4ef25af071ccf17ed3cccb6be3ad048dd19fdf8
BLAKE2b-256 checksum
How to use checksums
0df05b00a0e08e8c170052d9abd82d726a356827d3bd16ecd9d73d87ee1d667d
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-win_arm64.whl

Download URL django_litestream-0.5.17-py3-none-win_arm64.whl
Size 36.7 MB
Tags Python 3 Windows ARM64
SHA-256 checksum
How to use checksums
bdf6d92c1ad1d6d2eda0c07ef21ebba9346efeb61aff27624dbd79dfd6378c80
BLAKE2b-256 checksum
How to use checksums
514e333cc76c2b0486cd8bd11a6b35f959181066920eeec4d8fdd3614db1e772
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-win_amd64.whl

Download URL django_litestream-0.5.17-py3-none-win_amd64.whl
Size 40.0 MB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
95daf5a393c50525c1f549808e4005d2ed4f37ab511db5986ef7cada3321296e
BLAKE2b-256 checksum
How to use checksums
b824063d7e53567653b106c893e6ecd5052df17343d34633d459948b42c73bfe
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl

Download URL django_litestream-0.5.17-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Size 39.0 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3
SHA-256 checksum
How to use checksums
2a96489dfaedcf18f3ca829f39b57b353b05de141684e4e527d2da0ae7ad54e4
BLAKE2b-256 checksum
How to use checksums
3d5422d4820002280a771184cff2545936a29be5e9f318060665f5b90ee51867
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl

Download URL django_litestream-0.5.17-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Size 36.3 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3
SHA-256 checksum
How to use checksums
4f8f525478510db4b8ee817cde201b58a8d524ec38adad1ae075a818092a3789
BLAKE2b-256 checksum
How to use checksums
6aee1def65e41050d1c2465f5fbce88b6e9f233291e5e31719ed314c46e4a4ed
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-macosx_11_0_arm64.whl

Download URL django_litestream-0.5.17-py3-none-macosx_11_0_arm64.whl
Size 37.6 MB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
50ff4bde89aac52c63a55a24706a528a2525534162a0ecc7d08b317786f01d3c
BLAKE2b-256 checksum
How to use checksums
07f83589a2a78c57949d41b8ca0b5d049c8d89cf956102e1b5d41e537cda379e
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-macosx_10_9_x86_64.whl

Download URL django_litestream-0.5.17-py3-none-macosx_10_9_x86_64.whl
Size 40.1 MB
Tags Python 3 macOS 10.9+ x86-64
SHA-256 checksum
How to use checksums
d64615c24e172744d48328be8c08a4d2c8f2e4241b8a426c781ea0ecb4989de6
BLAKE2b-256 checksum
How to use checksums
f6ebca98e4de16e5d13d955f0c0aa38dd9ea594c9b64391501e913c74a19f7fc
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 Sep 10, 2026.

Transparency log

Release files / django_litestream-0.5.17-py3-none-any.whl

Download URL django_litestream-0.5.17-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4b159934e785e6096856eaeb02c713d7913a5195554653a6d0b05eb249d3ca79
BLAKE2b-256 checksum
How to use checksums
bbfa36a7c14248f813a7c624fff97a6cabca367a303b94c2132a1f1013111f90
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 Sep 10, 2026.

Transparency log
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