Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Muhammadbugaje/NAMETS_Website/llms.txt

Use this file to discover all available pages before exploring further.

The Gallery module organises NAMETS photos into date-stamped albums. Each album (Gallery) holds one or more images (GalleryImage) stored in Cloudinary, with support for individual captions and manual image ordering. Albums are ordered by event date so the most recent activity always appears first.

Data Models

An album representing a single event, activity, or theme.
FieldTypeNotes
titleCharFieldAlbum title, max 200 chars
descriptionTextFieldOptional description of the event or occasion
dateDateFieldDate of the event; defaults to today
cover_imageCloudinaryFieldOptional cover image stored in Cloudinary gallery/ folder
created_atDateTimeFieldAuto-set when the album is created
Ordering: Albums are sorted by -date (newest event first), then -created_at as a tiebreaker. This means a freshly created album for today will always appear at the top.

GalleryImage

An individual photo within an album.
FieldTypeNotes
galleryForeignKeyParent Gallery; deletes images if album is deleted
imageCloudinaryFieldStored in Cloudinary gallery/ folder
captionCharFieldShort description of the photo (optional), max 200 chars
orderPositiveIntegerFieldManual position within the album; lower = first
Ordering: Images sort by order (ascending) within their album. Assign order = 0 to all images for automatic FIFO ordering, or set distinct values for a custom sequence.

Cloudinary Integration

All images — both album covers and individual gallery photos — are stored in Cloudinary under the gallery/ folder path. This means:
  • Images are served via Cloudinary’s global CDN for fast delivery.
  • Cloudinary handles format optimisation and responsive variants automatically.
  • Deleting an image from the admin removes the database record but does not automatically purge the asset from Cloudinary storage; manual cleanup may be needed for storage management.
Both the Gallery.cover_image and GalleryImage.image fields use folder='gallery' in their CloudinaryField definition, so all gallery assets are grouped together in the Cloudinary media library.

URL Routes

All routes are under the gallery app namespace with the URL prefix /gallery/.
NameURL PatternViewDescription
list/gallery/gallery_listPaginated list of all albums
detail/gallery/<int:pk>/gallery_detailSingle album with all its images

Managing Albums

1

Create a new Gallery album

In the Django admin, navigate to Gallery → Galleries and click Add Gallery. Enter a title, the event date, an optional description, and an optional cover image.
2

Add images to the album

After saving the album, open it again and use the GalleryImage inline to upload photos. For each image, optionally add a caption and set the order field to control the sequence.
3

Set a cover image

Upload a representative photo in the cover_image field of the Gallery record. This image is displayed on the album list page as the album thumbnail.
4

Reorder images

Change the order integer on any GalleryImage record. Lower numbers appear first. Images with the same order value are displayed in database insertion order.
If you want to feature a particular photo as the first image in an album, set its order = 1 and leave all other images at order = 0 — images with a higher numerical order will appear later even if they have order = 0, since 0 < 1.

Album List View

The gallery_list view renders all Gallery records ordered by -date, -created_at. Each album shows its cover image (if set), title, date, and description excerpt.

Album Detail View

The gallery_detail view accepts a primary key (pk) and renders the full album with all associated GalleryImage records sorted by order.

Build docs developers (and LLMs) love