Skip to main content

A Django storage backend for local development that downloads files from the live site on the fly.

Project description

django-localdevstorage is a set of storage backends that helps during development. Instead of having to copy all user generated media from the live site for local development, the storage backends provided by django-localdevstorage will download media files that are not available locally “on demand”.


Set one of the provided storage backends in your These are:

  • HTTP: DEFAULT_FILE_STORAGE = 'localdevstorage.http.HttpStorage'
  • (more will follow)


If you use django-filer 0.9 or higher, you have to make sure that localdevstorage is not used as the thumbnail storage, e.g. by adding this to your settings:

    'public': {
        'thumbnails': {
            'ENGINE': '',
            'OPTIONS': {},
            'THUMBNAIL_OPTIONS': {
                'base_dir': 'filer_public_thumbnails',


Set the fallback domain that should be used to fetch missing files. This is usually the protocol (http or https) and the domain your live site:



Earlier versions of this library used LOCALDEVSTORAGE_HTTP_FALLBACK_URL. While this still works, it is recommended to update your settings to the new name. LOCALDEVSTORAGE_HTTP_FALLBACK_URL will be removed in a future version.

If your server is secured with HTTP basic auth, you can provide a username and password:



There are three settings that need to be configured for the SFTP backend:

  • LOCALDEVSTORAGE_SFTP_ROOT_PATH: this should be the MEDIA_ROOT on the remote machine in most cases.


  • The SFTP backend is much slower than the HTTP backend, which you should use in most cases. The SFTP backend is only really useful if your media files are not directly accessible through unauthenticated HTTP.
  • because the SFTP backend can’t prompt for a password, make sure that a connection can be established through public key exchange.


Although we took special care not to do anything destructive on the remote machine, bugs in our code or in upstream libraries can always happen. This alone should be reason enough to use the HTTP backend in almost all cases, since it is, by definition, read only.


  • Since django-localdevstorage extends a Django storage backend (FileSystemStorage to be precise), only code that uses Django’s file storage abstraction works with django-localdevstorage. Code that bypasses Django and accesses files directly will not benefit.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-localdevstorage, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size django_localdevstorage-0.5-py2.py3-none-any.whl (7.7 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size django-localdevstorage-0.5.tar.gz (7.3 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page