Skip to main content

A fully-featured dummy database backend for Django that allows running all standard Django apps without a real database

Project description

Django Dummy Database

A fully-featured dummy database backend for Django that allows running all standard Django apps (admin, auth, contenttypes, etc.) without a real database.

Features

  • 🚀 Run Django with all standard apps - no database required
  • 💾 In-memory storage - data persists during runtime
  • 🔄 Full transaction support simulation
  • 📊 Works with migrations - creates tables in memory
  • 🎯 Compatible with Django 3.2+
  • 🛡️ All database exceptions properly defined
  • 🔧 No configuration changes needed - just swap the database backend

Installation

pip install django-dummy-database

Usage

Simply change your DATABASES setting in settings.py:

DATABASES = {
    'default': {
        'ENGINE': 'django_dummy_database',
        'NAME': 'dummy_db',
    }
}

That's it! You can keep all your standard Django apps:

INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    # your apps...
]

MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'django.contrib.sessions.middleware.SessionMiddleware',
    'django.middleware.common.CommonMiddleware',
    'django.middleware.csrf.CsrfViewMiddleware',
    'django.contrib.auth.middleware.AuthenticationMiddleware',
    'django.contrib.messages.middleware.MessageMiddleware',
    'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

How It Works

The backend creates an in-memory storage that:

  • Initializes all system tables (django_content_type, auth_user, etc.)
  • Simulates SQL queries and returns appropriate results
  • Maintains sequences for auto-increment fields
  • Supports transactions, savepoints, and all standard database operations
  • Handles migrations by creating tables in memory

Use Cases

  • Development: Work without setting up a real database
  • Testing: Run tests faster without database overhead
  • CI/CD: Simplify continuous integration pipelines
  • Demos: Create portable demo applications
  • Static Sites: Build Django sites that don't need persistent storage

Requirements

  • Python 3.8+
  • Django 3.2+

License

MIT License - see LICENSE file for details.

Download files

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

Source Distribution

django_dummy_database-1.0.1.tar.gz (8.3 kB view details)

Uploaded Source

Built Distribution

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

django_dummy_database-1.0.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file django_dummy_database-1.0.1.tar.gz.

File metadata

  • Download URL: django_dummy_database-1.0.1.tar.gz
  • Upload date:
  • Size: 8.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for django_dummy_database-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b763bad91710baaf885fcdcf7308d4ed4147ff8e3a0d1311044319fa387a7224
MD5 030369513cdec08fb40dc0afe7a86983
BLAKE2b-256 681955f1d3e8d225404b98ef5a5cd69f30bba464e0fc33c5af30244aa0fb5275

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_dummy_database-1.0.1.tar.gz:

Publisher: publish.yml on MagIlyasDOMA/django-dummy-database

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_dummy_database-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_dummy_database-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 fd2d2902917c586356899dc6199dc29228665229971b6463bf139915715a87ab
MD5 9c38bd9e46064414073697ccc973c2a1
BLAKE2b-256 59ac128b4393e97c2197c882eb99ae0356d3e7616b5d72b5943a5290d51079de

See more details on using hashes here.

Provenance

The following attestation bundles were made for django_dummy_database-1.0.1-py3-none-any.whl:

Publisher: publish.yml on MagIlyasDOMA/django-dummy-database

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

Supported by

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