Skip to main content

A mongo GridFS storage backend for django

Project description

A helper app for using MongoDB’s GridFS as a storage backend for django.

mongo_storage contents include:

models.py
  • MongoFileMixin: a model mixin creating a MongoFileField called content

  • MongoDeleteFileMixin: a model mixin that will delete the underlying file when the model is deleted

fields.py
  • MongoFileField: a custom file field that gives you access to the file name through a ‘file_name’ property. Useful because the GridFSStorage makes Django store the MongoDB ObjectId instead of the file name.

storage.py
  • GridFSStorage: the Django storage module to interact with the pymongo, MongoDB’s python adapters

admin.py
  • MongoFileAdminMixin: gives the ModelAdmin access to the stored file’s file name and file size.

  • DeleteActionMixin: allows ModelAdmin to call the delete method on each model being deleted (so the underlying file will be delete also) when deleting items in bulk.

Dependencies:
  • mongodb Database

  • pymongo

  • django

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

django-mongo-storage-0.1.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file django-mongo-storage-0.1.tar.gz.

File metadata

File hashes

Hashes for django-mongo-storage-0.1.tar.gz
Algorithm Hash digest
SHA256 b81bfc81ff12ddbc3ead581e0f61b870b49805cab7d5e14da846a898dbc86708
MD5 2ece6cccb7d6a91c3a9546a97e59f172
BLAKE2b-256 5c8320b6daa26e1820c6c3b082b46c65882fb0231419f062bed890a661988d09

See more details on using hashes here.

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