Skip to main content

djrm

CI Python versions Coverage License: BSD-3-Clause

djrm packages Django's ORM, migration framework, and database backends as a standalone library. It keeps the retained Django APIs under the djrm import namespace and omits the web framework.

This is an independent fork. It is not an official Django Software Foundation project.

Installation

The distribution, Python import namespace, and command are all named djrm.

python -m pip install djrm

Release builds are published to PyPI. See Maintenance and releases for the release policy.

Included

  • Models, fields, querysets, managers, expressions, and aggregations
  • Schema migrations and data migrations
  • SQLite, PostgreSQL, MySQL, and Oracle backends
  • djrm.contrib.contenttypes and djrm.contrib.postgres
  • Database-focused commands including makemigrations, migrate, showmigrations, dumpdata, and loaddata

HTTP handling, URL routing, views, middleware, templates, forms, auth, admin, sessions, static files, GeoDjango, and spatial database support are not included. The package does not provide a compatibility django namespace.

Minimal setup

import djrm
from djrm.conf import settings

settings.configure(
    DATABASES={
        "default": {
            "ENGINE": "djrm.db.backends.sqlite3",
            "NAME": ":memory:",
        }
    },
    DEFAULT_AUTO_FIELD="djrm.db.models.BigAutoField",
    INSTALLED_APPS=[],
)
djrm.setup()

Commands use the same settings conventions as Django:

export DJANGO_SETTINGS_MODULE=myproject.settings
djrm migrate
python -m djrm showmigrations

DJANGO_SETTINGS_MODULE keeps its upstream name. Only Python import paths move from django.* to djrm.*.

Development

Install uv, then run:

make install
make check
make test
make test-external
make build
make check-dist

make test runs the package smoke tests and the retained SQLite ORM suite. make test-external runs migrations and complex ORM queries against disposable PostgreSQL, MySQL, and Oracle Docker services, exercises SQLite alongside them, and opens each backend's real command-line client through djrm dbshell. It also verifies that the intentionally unsupported GIS namespace stays absent. Docker removes the containers, volumes, network, and local runner image when the test finishes or fails.

Maintenance and releases

main carries the currently supported Django LTS line. Production builds start from an exact official Django release tag and use SemVer:

Django 5.2.17 -> djrm 0.1.0
Django 6.2    -> djrm 1.0.0

djrm 0.x corresponds to Django 5.2 LTS, 1.x corresponds to Django 6.2 LTS, and each later LTS gets the next major. Within an LTS line, a newer Django patch tag increments the djrm minor; a djrm-only fix from the same tag increments the patch. The exact Django tag is recorded as release provenance. The update tool creates a separate worktree, performs the namespace conversion, applies the reviewed fork tree delta with a three-way merge, and stops for human review when upstream changed retained code incompatibly.

uv run python scripts/apply_django_lts.py \
  --django-ref 5.2.17 \
  --output ../djrm-5.2.17

See MAINTENANCE.md for the branch model, release gate, conflict workflow, and PyPI setup. SPEC.md defines the retained API.

License and attribution

The retained Django code remains under Django's BSD 3-Clause license. See LICENSE, LICENSE.python, and AUTHORS. Django is a registered trademark of the Django Software Foundation.

Download files

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

Source Distribution

djrm-0.1.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

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

djrm-0.1.1-py3-none-any.whl (2.0 MB view details)

Uploaded Python 3

File details

Details for the file djrm-0.1.1.tar.gz.

File metadata

  • Download URL: djrm-0.1.1.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for djrm-0.1.1.tar.gz
Algorithm Hash digest
SHA256 2a0e681b8519343079b82a647d31f321ca15c872dde049bc6a6948bae4b3fdff
MD5 00727906c1b968cb545b4f3a38a646f2
BLAKE2b-256 c53ac64a320699c5c107a08438ac267cab69fa01f5e2ec4fd1e94f0d10b40d55

See more details on using hashes here.

File details

Details for the file djrm-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: djrm-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for djrm-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 315252f5a4e35f8bec5dfe25c3c7be83476dd9c6afec6cbd25b741d4a26f2927
MD5 a4da1f40a91818dd586b851b2e5342bf
BLAKE2b-256 ce91a8b71afe8502205bfe17566a82cfd000f812904fcec781acff716150bfcc

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page