Skip to main content

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

Project description

dj-inmemorystorage

image

An in-memory data storage backend for Django.

Compatible with Django's storage API.

Supported Versions

  • Python 2.7 with Django 1.11
  • Python 3.5/3.6/3.7 with Django 1.11+
  • Python 3.8 with Django 2.2+

In general, we follow Python's supported versions and Django's supported versions. Any major change in version support will be released as a new major version.

Usage

In your test settings file, add

DEFAULT_FILE_STORAGE = 'inmemorystorage.InMemoryStorage'

By default, the InMemoryStorage backend is non-persistant, meaning that writes to it from one section of your code will not be present when reading from another section of your code, unless both are sharing the same instance of the storage backend.

If you need your storage to persist, you can add the following to your settings.

INMEMORYSTORAGE_PERSIST = True

Differences

This library is based on django-inmemorystorage by Cody Soyland, with modifications made by Seán Hayes with support for the url method, with additional support from Tore Birkeland for writing to the file.

Wave's modifications include packaging, and test modifications such that python setup.py test works. This version also bumps the version to 1.0.0 and renames it to dj-inmemorystorage such that it doesn't conflict on PyPI.

The biggest difference is that this package works with Django 1.4 now (previously only 1.5+). It also supports Python 2.6/2.7 with Django 1.4+, Python 3.2/3.3/3.4 with Django 1.5+ and Python 3.5/3.6 with Django 1.7+.

Contributing

  1. Ensure that you open a pull request
  2. All feature additions/bug fixes MUST include tests

Project details


Download files

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

Source Distribution

dj-inmemorystorage-2.0.0.tar.gz (6.7 kB view details)

Uploaded Source

Built Distribution

dj_inmemorystorage-2.0.0-py2.py3-none-any.whl (6.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file dj-inmemorystorage-2.0.0.tar.gz.

File metadata

  • Download URL: dj-inmemorystorage-2.0.0.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.41.0 CPython/3.8.0

File hashes

Hashes for dj-inmemorystorage-2.0.0.tar.gz
Algorithm Hash digest
SHA256 72d3a3f25bbf097fb3766e2da87e2bcdaf1c1e1c45edefe74f8153db92948532
MD5 788c32f83b481d4dc8fb254dcbe173be
BLAKE2b-256 bec26f6d1fc31d658558744bce4d86adf289c62344b69f0b631a33008d821df3

See more details on using hashes here.

File details

Details for the file dj_inmemorystorage-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: dj_inmemorystorage-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 6.0 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.8.0 tqdm/4.41.0 CPython/3.8.0

File hashes

Hashes for dj_inmemorystorage-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57a3d343a3f01ea10f2e4fd0583caa08716af9b4c939413cd495a519d98c8264
MD5 57609808bde8bc4bb87822e70361b1ac
BLAKE2b-256 004a469bce9f00b418c508c461ffc6057b22c094142f5eea8459d753c585f007

See more details on using hashes here.

Supported by

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