A non-persistent in-memory data storage backend for Django.
Project description
dj-inmemorystorage
An in-memory data storage backend for Django.
Compatible with Django’s storage API.
Supported Versions
Python 2.6/2.7 with Django 1.4+ Python 3.2/3.3/3.4 with Django 1.5+
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+ and Python 3.2/3.3/3.4 with Django 1.5+.
Contributing
Ensure that you open a pull request
All feature additions/bug fixes MUST include tests
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file dj-inmemorystorage-1.4.0.tar.gz
.
File metadata
- Download URL: dj-inmemorystorage-1.4.0.tar.gz
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 35a37fac5955c3d9519fcab0cc7d88b43dc9bc95ffd2a6312badfa489ed30fd2 |
|
MD5 | 6c3759e295b7db80e1b21d0008404804 |
|
BLAKE2b-256 | e34c0549126da3dfff44e04532ce6b8b36c3f2e04d12cad5e457105f8480b3f2 |