Skip to main content

django-custom-storage PyPi license

PyPi status PyPi version PyPi python version PyPi downloads PyPi downloads PyPi downloads

GitHub GitHub release GitHub release

Test codecov.io pre-commit.ci status gitthub.com

Check Demo Project

  • Check the demo repo on GitHub

Requirements

  • Python 3.10+ supported.
  • Django 4.2+ supported.

Setup

  1. Install from pip:
pip install django-custom-storage
  1. Modify settings.py by adding the app to INSTALLED_APPS:
INSTALLED_APPS = [
    # ...
    "compressor",
    "custom_storage",
    # ...
]
  1. Configure storage in settings.py. The package ships sensible defaults and reads the project specifics from APP_CONFIG["custom_storage"]; call apply_storage_defaults at the end of the file so the STORAGES, compression and AWS settings are derived for you:
# Project paths (kept in the project; not owned by the package)
MEDIA_ROOT = "/var/opt/your_project_name/mediaroot/"
STATIC_ROOT = "/var/cache/your_project_name/staticroot/"

# AWS credentials
AWS_ACCESS_KEY_ID = "YOUR_PROJECT_AWS_ACCESS_KEY_ID"
AWS_SECRET_ACCESS_KEY = "YOUR_PROJECT_AWS_SECRET_ACCESS_KEY"

# Project-specific options; everything else falls back to the package defaults.
APP_CONFIG = {
    "custom_storage": {
        "BUCKET_NAME": "your_project_bucket_name",
        "CUSTOM_DOMAIN": "cdn.your_project_bucket_name.com",
        # Optional overrides: FILE_EXPIRE, DEFAULT_ACL, PRIVATE_LOCATION, ...
    },
}

from custom_storage.conf import apply_storage_defaults

apply_storage_defaults(globals())

Top-level Django settings always win, so projects that already declare STORAGES, COMPRESS_* or AWS_* keep working unchanged. To serve assets from the local filesystem (handy in development) start the server with --force-local-storage or set FORCE_LOCAL_STORAGE = True.

See Settings for every available key and Storage classes for the backends, including the private storage that serves non-public uploads through signed, expiring URLs.

Run Example Project

git clone --depth=50 --branch=django-custom-storage https://github.com/DLRSP/example.git DLRSP/example
cd DLRSP/example
python manage.py runserver

Now browser the app @ http://127.0.0.1:8000

Metadata

Release files for django-custom-storage 0.3.61

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-custom-storage 0.3.61
File Size Uploaded Provenance Actions
django_custom_storage-0.3.61.tar.gz 43.7 kB Without provenance Details for django_custom_storage-0.3.61.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-custom-storage 0.3.61
File Interpreter ABI Platform Actions
django_custom_storage-0.3.61-py3-none-any.whl Python 3 none any Details for django_custom_storage-0.3.61-py3-none-any.whl

Total release size: 119.9 kB

Release files / django_custom_storage-0.3.61.tar.gz

Download URL django_custom_storage-0.3.61.tar.gz
Size 43.7 kB
Tags Source
SHA-256 checksum
How to use checksums
32173f7faa765d5a35d670644613fa75b3dae26d5a2b6eecb46fc5ab773f086c
BLAKE2b-256 checksum
How to use checksums
f28c73ccef4bdb6e695658edc4958e8a64c51fc35c4cd0d0b11e123bc5bf169d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / django_custom_storage-0.3.61-py3-none-any.whl

Download URL django_custom_storage-0.3.61-py3-none-any.whl
Size 76.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
acbf284a876dbf209c448c36ea0791cd0d27cde64e1144e1b11f90b02960b269
BLAKE2b-256 checksum
How to use checksums
a7711a98d421ecb900aae8e3c1936db20a50394a6d9bcf89ae47ee9d39d927f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for django-custom-storage 0.3.61

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.61 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page