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/'
If your server is secured with HTTP basic auth, you can provide a username and password:
LOCALDEVSTORAGE_HTTP_USERNAME = 'foo' LOCALDEVSTORAGE_HTTP_PASSWORD = 'bar'
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
Built Distribution
File details
Details for the file django-localdevstorage-0.5.tar.gz
.
File metadata
- Download URL: django-localdevstorage-0.5.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db1b2719dff305b91a117c9391887c5c391600acba6f2e41ecea5efee47d8e76 |
|
MD5 | 6efd773929303e60d6bfb8d548bbef98 |
|
BLAKE2b-256 | 92711c12dff431c46d2142fb917fcad68d50e86e8a7a2629788904af7a4fe5fe |
File details
Details for the file django_localdevstorage-0.5-py2.py3-none-any.whl
.
File metadata
- Download URL: django_localdevstorage-0.5-py2.py3-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 181939624a9dca244b0a72837a84baa1c4045ba47f3cd56632c21eb87298498d |
|
MD5 | 97da3687ec1b02ab2cbe8afad0671ec8 |
|
BLAKE2b-256 | 9bbfee557b34c561647b8c43f5e0fc574ec18b2bce42c0db04beadc918be7c71 |