For a big installations, storing a lot of files in a single directory may lead to performace problems. To avoid this problem, this storage uses sub-directories to store file content. It uses 2-level directory structure, based on file content MD5 sum.

This storage will save space for you, if some files are stored more then once. You can use single directory to store all files for different models in project.

Install:

svn co http://svn.halogen-dg.com/svn/repos/hdg/trunk -r HEAD hdg

To use in model:

from hdg.djangoapps.MD5Storage.storage import MD5Storage

class SomeModel(models.Model):
    some_picture = models.ImageField(storage=MD5Storage(),
                                     upload_to='pictures')
...