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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django_litestream-0.5.16.tar.gz (11.3 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

django_litestream-0.5.16-py3-none-win_arm64.whl (36.5 MB view details)

Uploaded Python 3Windows ARM64

django_litestream-0.5.16-py3-none-win_amd64.whl (39.9 MB view details)

Uploaded Python 3Windows x86-64

django_litestream-0.5.16-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl (38.9 MB view details)

Uploaded Python 3musllinux: musl 1.1+ x86-64

django_litestream-0.5.16-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl (36.0 MB view details)

Uploaded Python 3musllinux: musl 1.1+ ARM64

django_litestream-0.5.16-py3-none-macosx_11_0_arm64.whl (37.4 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

django_litestream-0.5.16-py3-none-macosx_10_9_x86_64.whl (40.0 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

django_litestream-0.5.16-py3-none-any.whl (10.9 kB view details)

Uploaded Python 3

File details

Details for the file django_litestream-0.5.16.tar.gz.

File metadata

  • Download URL: django_litestream-0.5.16.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for django_litestream-0.5.16.tar.gz
Algorithm Hash digest
SHA256 2dae2129c1fd5c25ed1756a16c116deb715e6ebb9c8e29a7ec0fe3a95f373ecd
MD5 96e7823178704185bd29a3409f394fab
BLAKE2b-256 6c4db3a272dd6a35192196e384d4b60b3716d3df3fe014e6db9245f97d743f4f

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16.tar.gz:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-win_arm64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 46f5d0c46a1bba58fe21e4dc95cfa7341ba8fcdf70725e1e98017b1efbe8018a
MD5 c649766e54a2efa8122125a2227847ca
BLAKE2b-256 dc89de4745f7cc40b78d00b0132d3f8fc35109a7c21b759a907d7b9465acff04

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-win_arm64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 af9046d20381b5f2224b238cf968c7259a0be9fb0bdcf5a65dd8c5a2d3d0e20a
MD5 bf1344cf16d6d747b07048ba14fa3270
BLAKE2b-256 c546f2ba7d30b4714e3366486b5fc6c0f51d29192cab01da30294a0a536be845

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-win_amd64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl
Algorithm Hash digest
SHA256 91d8d278bd2fea17b3befd475db91292edb6dd57cbf302771a30ed3d9036cc3e
MD5 f387ca4a80be8d2abbc4188a0d4a34ba
BLAKE2b-256 2149708a7e11a807b9fe1f10b35ee9d2156bc7168b94159089c46b79bb848a8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl
Algorithm Hash digest
SHA256 d7a4b1190c45edb842077842d2df19c0c6769da98d42fd46c09eef79fe1de249
MD5 f9f7d895da93a89fa4fbae178b12706e
BLAKE2b-256 34b3b072b188479555b7ea838babcc8fbefde1b874eed0056c6170dc237b49ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 24ac7dabefb449baab5ffce68b89045daee69c628ccd97d8ee59d72a065fa952
MD5 f5981c16ca07736c53a8fd2115ad1a87
BLAKE2b-256 640998ef1493e8be65b49c90060f20f0dcdeb90199dba2b0cfb5fd44ccfa0800

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-macosx_11_0_arm64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 d527fcdcbff9b13202e19ce6be449568d5450506a15612e5d3e71a9b43f07def
MD5 8a380ee2949c1e9c586d77842f256144
BLAKE2b-256 234056632fba9caba79f6201cf5f7a981d4f8324281df1769b00218b60bba143

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-macosx_10_9_x86_64.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file django_litestream-0.5.16-py3-none-any.whl.

File metadata

File hashes

Hashes for django_litestream-0.5.16-py3-none-any.whl
Algorithm Hash digest
SHA256 b5fafe5ed5a41eafcdb8ee6be7932a2a9d8a0e3cd37bef8b802f12ba074369f0
MD5 908a2bebbef74736a61b1be6aa751f8f
BLAKE2b-256 2d890097b805ce46f6721cdd4ae2ecd3c948a0895fbe2858c612a4d285be4f53

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_litestream-0.5.16-py3-none-any.whl:

Publisher: publish.yml on Tobi-De/django-litestream

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.6.0

2 files

This release

0.5.16 This release

8 files

0.5.15

8 files

0.5.13

8 files

0.5.12

8 files

0.5.11.post6

6 files

0.5.11.post5

6 files

0.5.11.post4

6 files

0.5.11.post3

6 files

0.5.11.post2

6 files

0.5.11.post1

6 files

0.5.11

6 files

0.5.2

2 files

0.5.1

2 files

0.5.0

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.0

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.1

2 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