skillfed

dj-inmemorystorage

A non-persistent in-memory data storage backend for Django.

dj-inmemorystorage v2.1.0 227.4K downloads/30d#9,179 on PyPI52
Permissive license BSD Abandoned released

What it is and what it does

dj-inmemorystorage provides a Django storage backend that keeps file data in memory rather than writing to disk. It implements Django's standard storage API, making it a drop-in replacement for testing scenarios where you want to avoid filesystem I/O. By default, each storage instance maintains its own isolated in-memory state; writes from one part of your code are not visible to another unless they share the same backend instance. You can enable persistence across instances by setting INMEMORYSTORAGE_PERSIST = True in your Django settings.

The package depends on Django and six, and is distributed as a pure-Python wheel with low install friction. However, it has been abandoned since 2020 and receives no maintenance. It was last tested against Django up to version 3.0 and Python up to 3.8, so compatibility with modern versions is unknown.

Use it for:

  • Unit testing Django applications without writing temporary files to disk during test runs.
  • Mocking file uploads in integration tests while keeping test data isolated between test cases.
  • Developing and testing Django apps in environments where filesystem access is restricted or slow.
  • Rapid prototyping of Django file-handling logic without managing temporary file cleanup.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

An in-memory storage backend for Django that implements Django's storage API without persisting data to disk by default.

Yes, if your Django and Python versions fall within the supported range (Django 1.11–3.0, Python 2.7 or 3.5–3.8) and you need a lightweight in-memory storage backend for testing. The permissive BSD license and zero known vulnerabilities are favorable. However, the package is abandoned and will not receive updates for modern Django or Python versions, so it is not suitable for new projects targeting current releases.

Install

dj-inmemorystorage on PyPI

pip

pip install dj-inmemorystorage

uv

uv add dj-inmemorystorage

poetry

poetry add dj-inmemorystorage

Installing dj-inmemorystorage

Before you install

Low install friction with a pure-Python wheel. However, the package is abandoned—last release was 2020-03-30, over six years ago. It remains marked Production/Stable and has no known vulnerabilities, but receives no maintenance updates.

License in practice

BSD license (permissive) places no restrictions on use, modification, or distribution in your own projects.

Quickstart

# In Django test settings:
DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'

# Optional: enable persistence across storage instances
INMEMORYSTORAGE_PERSIST = True

Requires Django and six as runtime dependencies; version support is limited to Python 2.7 with Django 1.11, or Python 3.5–3.8 with Django 1.11–3.0.

Verify before relying

  • Whether the package works with Django versions released after 3.0 or Python versions after 3.8.
  • Whether the non-persistent default behavior (data not shared across storage instances) meets your test isolation needs.
  • Whether the package's archived repository status means it will accept pull requests or security patches.

Package facts

License BSD (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — Django, six
Maintenance abandoned — 2,328 days since the last release
Last repo commit
First released
Downloads 227,403/month — #9,179 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dj_inmemorystorage-2.1.0-py2.py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: DjangoFramework :: Django :: 1.11Framework :: Django :: 2.0Framework :: Django :: 2.1Framework :: Django :: 2.2Framework :: Django :: 3.0Intended Audience :: DevelopersLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Internet :: WWW/HTTP

Tags

django in-memory storagedjango test storage backenddjango file storage mockdjango non-persistent storagedjango storage api implementation
django-testingmock-storage

More WWW/HTTP packages