Wagtail Photo Gallery
With this extention you are just a few steps away from a simple photo gallery for your wagtail page.
The gallery is configurable with the wagtail admin panel and is suited for large amounts of photos.
The key idea of this package is to store and manage photos independently of the usual wagtail images. Instead, all photos are assigned to albums and can be managed by a drag-and-drop sorting widget (which also supports item selection for mass-dragging and deletion).
To organize your photos, a Collection is assigned to each album, by default the Root Collection is used.
Embedding the photo gallery within a StreamField is now done by adding a GalleryBlock with reference to the desired Collection.
Installation
pip install wagtail-photo-gallery[pillow]
# or
pip install wagtail-photo-gallery[pillow-simd]
If you need the fastest possible image uploading (Faster resizing) use pillow-simd.
Settings
Add the following to your settings (base.py):
INSTALLED_APPS = [
#...
'wagtail_photo_gallery',
'wagtail.contrib.routable_page',
#...
]
Update your database structure using (remember to create a backup first):
./manage.py migrate
Example
Once you've installed this addon and configured the settings as above,
all you need to do is to inherit from ImageGalleryMixin and to add GalleryBlock to your StreamField.
# models.py
from wagtail.models import Page
from wagtail.fields import StreamField
from wagtail.admin.panels import FieldPanel
from wagtail_photo_gallery.blocks import GalleryBlock
from wagtail_photo_gallery.mixins import ImageGalleryMixin
class YourWagtailPage(ImageGalleryMixin, Page):
content = StreamField([
#...
("gallery", GalleryBlock()),
#...
], blank=True)
# content panel for the CMS (same as always)
content_panels = Page.content_panels + [
FieldPanel("content"),
]
If you want to use the pre-defined CSS-flexbox layout for the albums,
you need to include the following css code in your gallery page (YourWagtailPage)
{% include 'wagtail_photo_gallery/extra_css.html' %}
Minimal template example
{% extends "base.html" %}
{% load wagtailcore_tags %}
{% load static %}
{% block body_class %}template-homepage{% endblock %}
{% block content %}
{% for block in page.content %}
{% include_block block %}
{% endfor %}
{% endblock content %}
{% block extra_css %}
{% include 'wagtail_photo_gallery/extra_css.html' %}
{% endblock %}
Metadata
Release files for wagtail-photo-gallery 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| wagtail_photo_gallery-0.2.0.tar.gz | 35.4 kB | Without provenance | Details for wagtail_photo_gallery-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| wagtail_photo_gallery-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for wagtail_photo_gallery-0.2.0-py3-none-any.whl |
Total release size: 96.2 kB
Release files / wagtail_photo_gallery-0.2.0.tar.gz
| Download URL | wagtail_photo_gallery-0.2.0.tar.gz |
|---|---|
| Size | 35.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3a343597952eb8a4b5190d9444fb7e832b9baf64dd0aa3778e4b953faa2a6a07
|
|
BLAKE2b-256 checksum How to use checksums |
7cdde83ff39e387fdcd07f9cd52e4a240132248c2d76c3261cf43663643bffd6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Release files / wagtail_photo_gallery-0.2.0-py3-none-any.whl
| Download URL | wagtail_photo_gallery-0.2.0-py3-none-any.whl |
|---|---|
| Size | 60.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
93c63fbd80b1822c9bfc53a2c90e79a92550c3f2146a0849965e8eea15842612
|
|
BLAKE2b-256 checksum How to use checksums |
7898e33a9111dd67f668f349f0616090498741d4b8edaebcdbf219419ce384f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.7
|
Security for wagtail-photo-gallery 0.2.0
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.