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 storage backend that gives random names to files.

By default, deals with conflicting filenames by appending an underscore to the file. For instance, if you try to create hello.txt when it already exists, it will rename it as hello_.txt.

django-randomfilenamestorage creates random filenames, so if you try to create hello.txt, it will save it as 7z0a8m25sh9fyitx.txt. Directory names and extensions are preserved, only the root filename is randomized.


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

pip install django-randomfilenamestorage

Quick Start

In your Django settings file:

  • Optionally, add 'django-dbstorage' to INSTALLED_APPS

This gives you random filenames, backed on Django’s FileSystemStorage storage class.


You can define a new underlying storage class by using RandomFilenameMetaStorage to wrap it:

from import get_storage_class

from import RandomFilenameMetaStorage

RandomFilenameMyStorage = RandomFilenameMetaStorage(

RandomFilenameMetaStorage defaults to 16-character root filenames. To change the default, define settings.RANDOM_FILENAME_LENGTH to a different integer value.

To change the filename length of a wrapped storage class, pass in a length argument to RandomFilenameMetaStorage. To override it for a particular storage instance, pass in a randomfilename_length argument to its constructor.

Efficient random filename generation

RandomFilenameMetaStorage is careful about not overwriting existing files, on creation. Unfortunately, many storage classes do not throw an OSError with EEXISTS when they detect a duplicate file on _save().

If the underlying storage class accepts uniquify_names=False in its constructor, RandomFilenameMetaStorage will reduce the number of round-trips to the underlying storage class and make random filename generation more efficient.

Safe storage classes include:

Release History

Release History


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

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-randomfilenamestorage-1.1.tar.gz (6.3 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