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”.

Installation

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

  • HTTP: DEFAULT_FILE_STORAGE = 'localdevstorage.http.HttpStorage'

  • (more will follow)

HTTP

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:

LOCALDEVSTORAGE_HTTP_FALLBACK_DOMAIN = 'http://www.example.com/'

SFTP

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

  • LOCALDEVSTORAGE_SFTP_USER

  • LOCALDEVSTORAGE_SFTP_HOST

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

Caveats

  • 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.

Source Distribution

django-localdevstorage-0.3.tar.gz (5.7 kB view details)

Uploaded Source

File details

Details for the file django-localdevstorage-0.3.tar.gz.

File metadata

File hashes

Hashes for django-localdevstorage-0.3.tar.gz
Algorithm Hash digest
SHA256 54348e91cf582c4e411b0aac717c75245bda639fc7dfe598ac1d92698c83fbeb
MD5 67719ac1e7ed12404a491b9592c4ad99
BLAKE2b-256 430ed5b951b27e41ea7970b3b8d748a130e251ea037cb2f1d416bb26bed1a968

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page