Skip to main content

Simple Django galleries.

Project description

A set of utilities for creating gallery models and admin classes.


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.


In older versions, we recommended that you extend django-gallery’s included ImageModel or EmbedModel classes if your gallery contained those types. Those models are now deprecated. Just define your own!

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)],

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.

from .models import ApartmentGallery
from galleries.admin import register_gallery_admin



This should register you new app with our galleries models and include the thumbnail preview.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for django-galleries, version 1.4.0
Filename, size File type Python version Upload date Hashes
Filename, size django-galleries-1.4.0.tar.gz (12.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page