A small reusable media app for Django projects
Project description
wbr_media
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 Detail
Asset inspection with preview, metadata, and image properties.
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
MediaAssetmodel - 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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
426683f701aa2d00ae0c3e05a339b27b1f138cf68c2d6ee46d76a2e0e3b24f25
|
|
| MD5 |
f1a86c8667b5869eec6c93e121012c10
|
|
| BLAKE2b-256 |
fe48535e8e5fe2452365efe57ac74bea44d9eeceb0db0179cf0b1c2954e591a8
|
Provenance
The following attestation bundles were made for wbr_media-0.1.1.tar.gz:
Publisher:
publish.yaml on HolisticNetworkingNet/wbr_media
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wbr_media-0.1.1.tar.gz -
Subject digest:
426683f701aa2d00ae0c3e05a339b27b1f138cf68c2d6ee46d76a2e0e3b24f25 - Sigstore transparency entry: 1370583913
- Sigstore integration time:
-
Permalink:
HolisticNetworkingNet/wbr_media@0605d9349bf59dd8b83c3cdd800c9a539d3d41e5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/HolisticNetworkingNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0605d9349bf59dd8b83c3cdd800c9a539d3d41e5 -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af67501a8f88c6cabd644e8f049afdb6a91e8a31d64d22dc0c175be86ece0c8a
|
|
| MD5 |
30c2f7ff9b871c02e8524fe495f31cca
|
|
| BLAKE2b-256 |
980a3a303c076088c1870e29f1fa84d89fe489cc4423fe42f0c01181f0e476ea
|
Provenance
The following attestation bundles were made for wbr_media-0.1.1-py3-none-any.whl:
Publisher:
publish.yaml on HolisticNetworkingNet/wbr_media
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
wbr_media-0.1.1-py3-none-any.whl -
Subject digest:
af67501a8f88c6cabd644e8f049afdb6a91e8a31d64d22dc0c175be86ece0c8a - Sigstore transparency entry: 1370584019
- Sigstore integration time:
-
Permalink:
HolisticNetworkingNet/wbr_media@0605d9349bf59dd8b83c3cdd800c9a539d3d41e5 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/HolisticNetworkingNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yaml@0605d9349bf59dd8b83c3cdd800c9a539d3d41e5 -
Trigger Event:
release
-
Statement type: