django-dbstorage 1.3

A Django file storage backend for files in the database

  Add it to your Download Basket!

 Add it to your Watch List!

0/5

Rate it!
send us
an update
LICENSE TYPE:
MIT/X Consortium License 
USER RATING:
UNRATED
  0.0/5
DEVELOPED BY:
Akoha Inc.
HOMEPAGE:
bitbucket.org
CATEGORY:
ROOT \ Internet \ HTTP (WWW)
django-dbstorage is a Django file storage backend for files in the database.

Installing

The easiest way to install django-dbstorage is to use pip:

pip install django-dbstorage

Quick Start

In your Django settings file:

- Add 'django-dbstorage' to INSTALLED_APPS
- Set DEFAULT_FILE_STORAGE to 'django_dbstorage.storage.DatabaseStorage'
- Set MEDIA_ROOT and MEDIA_URL to None.

Serving files

You must set MEDIA_URL to a view that will serve the static file.

This is left as an exercise to the reader.

Customizing

DatabaseStorage takes several options. To customize, subclass it and use that as DEFAULT_FILE_STORAGE. For instance:

class MyDatabaseStorage(DatabaseStorage):
 def __init__(self):
 super(MyDatabaseStorage, self).__init__(location='/tmp',
 base_url='/files/',
 uniquify_names=True)

Last updated on March 21st, 2011

requirements

#file storage #storage backend #Django #storage #backend #database

Add your review!

SUBMIT