Skip to main content

Simple Django galleries.

Project description

Django-Galleries
======================

This is a base class to bring in galleries to sites. Currently supports photos
and embedded videos. This app mostly has abstract models for you to use and
append too for custom thumbnail sizes, photo-sizes.


Example:
------------------------------

```py
# models.py
from galleries.models import Gallery, EmbedModel, ImageModel
from imagekit.models import ImageSpec
from imagekit.processors import Crop

class YouTubeVideo(EmbedModel):
thumbnail = models.ProcessedImageField([Crop(60, 60)],
upload_to='gallery_posters')

class Photo(ImageModel)
thumbnail = models.ImageSpec([Crop(60, 60)], image_field='original_image')


class ApartmentGallery(Gallery):

class GalleryMeta:
member_models = [Photo, YouTubeVideo]


# 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.

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

django-galleries-1.2.0.tar.gz (11.8 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page