An image gallery plugin for Wagtail
Project description
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 project 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.
A collection may be assigned to each album, which is then used to include all albums belonging to a collection in a GalleryBlock
.
The GalleryBlock
can be used in wagtails StreamField
to embed albums into your page.
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
INSTALLED_APPS = [
'wagtail_photo_gallery',
'wagtail.contrib.modeladmin',
'wagtail.contrib.routable_page',
'generic_chooser',
]
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
.
from wagtail.core.models import Page
from wagtail.core.fields import StreamField
from wagtail.admin.edit_handlers import StreamFieldPanel
from wagtail_photo_gallery.models import GalleryBlock, ImageGalleryMixin
class YourWagtailPage(ImageGalleryMixin, Page):
content = StreamField([
#...
("gallery", GalleryBlock()),
#...
], blank=True)
# content panel for the CMS (same as always)
content_panels = Page.content_panels + [
StreamFieldPanel("content"),
]
If you want to use the predefined 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' %}
Credits
This project was initially planned as a port of django-photo-gallery as the name of this addon suggests. Never the less, almost the entrie code is changed completely now due to incompability with wagtail and the incorporation of django-modelcluster.
Contributions to this project are welcome!
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
Built Distribution
File details
Details for the file wagtail_photo_gallery-0.1.0.tar.gz
.
File metadata
- Download URL: wagtail_photo_gallery-0.1.0.tar.gz
- Upload date:
- Size: 28.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6531f9dace6fdbbc75ddd0a18663179230c0aad2fc85a501fb05c38e7da1436 |
|
MD5 | 27a50830d6c8989a5fd49b95969653d4 |
|
BLAKE2b-256 | 33e0ebfadd85f728e46e58d0bfe0f43675745b2357af9d2e73e747d02cca1e5b |
File details
Details for the file wagtail_photo_gallery-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: wagtail_photo_gallery-0.1.0-py3-none-any.whl
- Upload date:
- Size: 36.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d7d07872947a7c4b4df2e6e979396fa085bfe0be7462462f1be37dd625b21ff4 |
|
MD5 | 33ee01ffcf4d48d9217a107b6f73e785 |
|
BLAKE2b-256 | a1fe58ee03d856ee921554e6d1ff132de8b6400391edd1bc332031d5ab4bfb15 |