This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

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

In your urls.py, add the following to urlpatterns:

url(r'^media/', include('django_dbstorage.urls'))

Or, if you want to specify more options, use:

url(r'^media/', include(django_dbstorage.urls.serve()))

You should set settings.MEDIA_URL to the root of this include, in this case: /media/.

If you do not wish to serve files from the database, don’t add anything to urls.py and set settings.MEDIA_URL to None.

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)

As a convenience, there is a NonUniquifyingDatabaseStorage class which does not attempt to find a unique filename when saving. This class throws an IOError with the EEXISTS status code, when attempting to _save().

This functionality is used by other packages, such as django-randomfilenamestorage.

Release History

Release History

1.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
django-dbstorage-1.3.tar.gz (10.5 kB) Copy SHA256 Checksum SHA256 Source Mar 21, 2011

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting