Skip to main content

django-bunny-storage

Provides Bunny.net file storage in Django.

Installation

django-bunny-storage requires Python >= 3.7.

pip install django-bunny-storage

Configuration

Everything is configured in your settings.py file.

To use:

  1. Add django_bunny_storage to your INSTALLED_APPS.
INSTALLED_APPS = [
    ...
    'django_bunny_storage'
]
  1. Add BUNNY_USERNAME and BUNNY_PASSWORD to your settings.
BUNNY_USERNAME = 'myzone'

BUNNY_PASSWORD = 'myzone-random-password-string'

# Optional
BUNNY_REGION = 'de'

These settings correspond to your storage zone's Username and Password found under FTP & API Access in your Bunny.net Storage dashboard.

You must include BUNNY_REGION if the default region, NY, does not match the region you set yourself.

  1. Change your media url and default file storage backend.
DEFAULT_FILE_STORAGE = 'django_bunny_storage.storage.BunnyStorage'

MEDIA_URL = 'https://myzone.b-cdn.net/' # The Pull Zone hostname.

The MEDIA_URL is set based on a linked Pull Zone that you setup in the Bunny.net dashboard.

In Templates

In order to display your media properly in templates, refer to Django's docs on the MEDIA_URL attribute to ensure you're not getting 404s when trying to load media.

Whenever referencing media, do

<img src="{{ MEDIA_URL }}{{ mymodel.file }}" />

Metadata

Release files for django-bunny-storage 0.1.2

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-bunny-storage 0.1.2
File Size Uploaded Provenance
django-bunny-storage-0.1.2.tar.gz 3.1 kB Without provenance Details

Release files / django-bunny-storage-0.1.2.tar.gz

Download URL django-bunny-storage-0.1.2.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
d834aa4a5196ccbcda9675c8fb82a23d49f23744fdd63f7e3a877a1489997b44
BLAKE2b-256 checksum
How to use checksums
7e95f1989847120d13c8161f620174cf5953a692c9318f84db42b804a602c320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.6.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.8.9

Security for django-bunny-storage 0.1.2

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.

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