Django-Galleries
A set of utilities for creating gallery models and admin classes.
Example:
models.py
Define models for all of the types you want to put in your gallery, then create a Gallery subclass that specifies which models to allow for its members.
from galleries.models import Gallery
from imagekit.models import ImageSpec
from imagekit.processors import Crop
class YouTubeVideo(models.Model):
title = models.CharField(max_length=50)
embed_code = models.TextField()
thumbnail = models.ProcessedImageField([Crop(60, 60)],
upload_to='gallery_posters')
class Photo(models.Model)
title = models.CharField(max_length=50)
description = models.CharField(max_length=255, blank=True)
original_image = models.ImageField(upload_to='galleries')
thumbnail = models.ImageSpec([Crop(60, 60)], image_field='original_image')
class ApartmentGallery(Gallery):
class GalleryMeta:
member_models = [Photo, YouTubeVideo]
The gallery class will automatically create a membership (through) model, which will be accessible at ApartmentGallery.Membership.
admin.py
from .models import ApartmentGallery
from galleries.admin import register_gallery_admin
register_gallery_admin(ApartmentGallery)
settings.py
INSTALLED_APPS = (
'imagekit',
...
)
This should register you new app with our galleries models and include the thumbnail preview.
Metadata
Release files for django-galleries 1.4.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 |
|---|---|---|---|---|
| django-galleries-1.4.0.tar.gz | 12.4 kB | Without provenance | Details for django-galleries-1.4.0.tar.gz |
Release files / django-galleries-1.4.0.tar.gz
| Download URL | django-galleries-1.4.0.tar.gz |
|---|---|
| Size | 12.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
599ad7e25884986f000455796304a38a239fdf857ae3c6733b9480c9a36be829
|
|
BLAKE2b-256 checksum How to use checksums |
272405315a10bc6f94f9b972f6423e5abbf6db27a241dc5cbfc91268f7173358
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-galleries 1.4.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.