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.
======================
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
Release history Release notifications | RSS feed
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 details)
File details
Details for the file django-galleries-1.2.0.tar.gz
.
File metadata
- Download URL: django-galleries-1.2.0.tar.gz
- Upload date:
- Size: 11.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75ed77542c30f5aeb19eb83e79ddcc9786f765e9b70b9100c35365b9f86daf1f |
|
MD5 | 32e80b090fb6cc05415090ea8173a5a9 |
|
BLAKE2b-256 | 2aa7ee39eda69f7f5de5dc6c15950da3d3e46dd39e4546de06a693915b37ac06 |