Skip to main content

A small reusable media app for Django projects

Project description

wbr_media

Python Django Status Tests

A small, reusable media app for Django.

wbr_media provides a clean way to store, manage, and render media assets without pulling in a full CMS or rebuilding the same patterns in every project.


📷 Screenshots

Media Index

A lightweight media library view with previews and metadata. Media index

Media Detail

Asset inspection with preview, metadata, and image properties. Media detail


Why WBR Media?

Django handles file uploads well, but it doesn’t provide a consistent, structured way to manage and render media across content types.

wbr_media is a small layer that standardizes:

  • how media is stored
  • how metadata is handled
  • how media is rendered in templates

without introducing a full CMS.

Why not just use Django FileField directly?

You can—but you'll end up reimplementing:

  • metadata extraction
  • file cleanup on replacement
  • consistent rendering patterns
  • image-specific handling

wbr_media provides these in a small, reusable layer.

✨ Features

  • Structured MediaAsset model
  • Automatic file metadata extraction (name, size, MIME type)
  • Image-specific metadata (dimensions, format, etc.)
  • Safe file replacement and deletion (no orphaned files)
  • Simple, flexible template tag for rendering media

📸 Example

{% load wbr_media_tags %}

{% render_media asset %}
{% render_media asset display="bare" class_name="card-image" %}

🚀 Installation

pip install -e .

Add to your Django settings:

INSTALLED_APPS = [
    ...
    "wbr_media",
]

Run migrations:

python manage.py migrate

🧠 Basic Usage

Upload media via Django admin, then render in templates:

{% load wbr_media_tags %}

{% render_media asset %}

Optional arguments

{% render_media asset size="full" %}
{% render_media asset display="bare" %}
{% render_media asset class_name="my-class" %}

Arguments

Argument Description
size Named size (default: "full" — currently original file)
display Controls markup:
figure (default for images)
bare (just <img>)
link (default for non-images)
class_name Passed through to the rendered element

⚙️ Configuration

Optional settings:

WBR_MEDIA = {
    "UPLOAD_TO": "assets/originals/%Y/%m/",
}

📦 What This Is

  • A lightweight media layer for Django projects
  • A consistent way to handle files + metadata
  • A simple rendering interface for templates

🚫 What This Is Not

  • Not a CMS
  • Not a full media library UI
  • Not trying to replicate WordPress

This is a focused, infrastructure-level tool.


🧪 Development

A demo project is included:

cd demo
python manage.py runserver

Testing

pytest wbr_media/tests.py

Visit:

http://127.0.0.1:8000/media-demo/


🛣️ Roadmap

Small, practical improvements:

  • Size-based image renditions
  • Better integration with project-specific design systems
  • Optional media usage tracking

No large UI or CMS features are planned.


📷 Screenshots (optional)

Add a screenshot of:

  • Admin media preview
  • Demo grid page

📄 License

All Rights Reserved.

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

wbr_media-0.1.1.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wbr_media-0.1.1-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file wbr_media-0.1.1.tar.gz.

File metadata

  • Download URL: wbr_media-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wbr_media-0.1.1.tar.gz
Algorithm Hash digest
SHA256 426683f701aa2d00ae0c3e05a339b27b1f138cf68c2d6ee46d76a2e0e3b24f25
MD5 f1a86c8667b5869eec6c93e121012c10
BLAKE2b-256 fe48535e8e5fe2452365efe57ac74bea44d9eeceb0db0179cf0b1c2954e591a8

See more details on using hashes here.

Provenance

The following attestation bundles were made for wbr_media-0.1.1.tar.gz:

Publisher: publish.yaml on HolisticNetworkingNet/wbr_media

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file wbr_media-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: wbr_media-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wbr_media-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af67501a8f88c6cabd644e8f049afdb6a91e8a31d64d22dc0c175be86ece0c8a
MD5 30c2f7ff9b871c02e8524fe495f31cca
BLAKE2b-256 980a3a303c076088c1870e29f1fa84d89fe489cc4423fe42f0c01181f0e476ea

See more details on using hashes here.

Provenance

The following attestation bundles were made for wbr_media-0.1.1-py3-none-any.whl:

Publisher: publish.yaml on HolisticNetworkingNet/wbr_media

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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