When the production site uploads folder gets really big you don’t want to rsync everything to your local machine just to fix a few bugs. Only download what is needed, right?
That’s what this storage class does.
Usage
Make sure that you only use this if DEBUG = True
Add the following settings:
DEFAULT_FILE_STORAGE = 'http_fallback_storage.FallbackStorage' FALLBACK_STORAGE_URL = 'http://example.com/media/'
Optionally, configure logging so that it’s easy to see why page loads would be slow when fetching media files. Either of the following snippets should be fine when added to your settings file:
FALLBACK_STORAGE_LOGGING = True import http_fallback_storage LOGGING = http_fallback_storage.LOGGING
or:
FALLBACK_STORAGE_LOGGING = True # LOGGING has already been defined import http_fallback_storage LOGGING.update(http_fallback_storage.LOGGING)
Optionally, specify a regular expression for skipping file downloads, e.g. the following regex to never download movies:
FALLBACK_STORAGE_SKIP = r'(\.mp4|\.mov)$'
Release files for django-http-fallback-storage 1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| django-http-fallback-storage-1.6.tar.gz | 3.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| django_http_fallback_storage-1.6-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 8.5 kB
Release files / django-http-fallback-storage-1.6.tar.gz
| Download URL | django-http-fallback-storage-1.6.tar.gz |
|---|---|
| Size | 3.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
70712ae8af9b94f86fe4b4a60a1653ffe24349792434c6553f48663a7f4764b2
|
|
BLAKE2b-256 checksum How to use checksums |
61df1ec30e48f104c50016598afaf3ed33252a406aef0aefa95f348cccf13133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.8
|
Release files / django_http_fallback_storage-1.6-py2.py3-none-any.whl
| Download URL | django_http_fallback_storage-1.6-py2.py3-none-any.whl |
|---|---|
| Size | 4.7 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
c33a5be0c9223a2397e3b4fd7578a3595b427a2dfcd7474f020d3b7bdcbc6f73
|
|
BLAKE2b-256 checksum How to use checksums |
4eebeb0a6966cbb79faf54679081babf45d5638a7b2aa4a3d03a448f4722ae09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.12.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.29.1 CPython/3.6.8
|