django-database-storage
This is a utility for Django that implements the Django Storage API (for storing FileFields, ImageFields, etc.) and stores the contents of the files in your Django database instead of on the filesystem.
This is mainly intended to be an easy-to-use way to store file attachments and get rid of the pain of managing filesystem access at run time, and the deployment issues that come with it. If your file attachment needs are simple, this will generally be a quick way to get your app working.
Features:
Store any file in any database supported by Django.
Simplify deployment and data management: No need to keep track of file attachments when migrating data from one server to another, since files live in the database.
Limitations:
Django does not support binary fields (issue #2417) and as of this writing, expects queries to always return unicode data (issue #5135). As a result, this library uses base64 encoding to make binary data safe for the database, which inflates data size by about 33%.
Databases are not always built with large file storage in mind (unlike filesystems). As such, this is based on the assumption that files are “reasonably” sized, meaning well under 1MB. Files are entirely loaded into RAM during requests. Your mileage may vary.
No performance guarantees whatsoever. The idea is that these are small image attachments for a blog or similar, not that you are hosting a Youtube clone in your Django database.
Getting Started
Install (pip install django-database-storage)
Read the help:
$ ./manage.py shell … >>> from database_storage import DatabaseStorage >>> help(DatabaseStorage)
License and Copyright
License: BSD
Originally derived from this snippet, although almost entirely rewritten for better robustness and clarity:
Copyright 2011 Mike Mueller, mike@subfocal.net. Original copyright 2009 (c) GameKeeper Gambling Ltd, Ivanov E
Metadata
Release files for django-database-storage 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-database-storage-0.1.2.tar.gz | 5.1 kB | Without provenance | Details for django-database-storage-0.1.2.tar.gz |
Release files / django-database-storage-0.1.2.tar.gz
| Download URL | django-database-storage-0.1.2.tar.gz |
|---|---|
| Size | 5.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9e932cd08df7fc26b714adc08fa273b99c978dcdf2788610ec554335e369be50
|
|
BLAKE2b-256 checksum How to use checksums |
b185d797477e5ac6a06097416f13d3ae28161b8bccd694cdc8ab60e28b4b86fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-database-storage 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.