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.

All user-uploaded images and files on the NAMETS platform are stored in Cloudinary rather than on the server’s local filesystem. This design means uploaded media persists across Render deployments and container restarts, where a local media/ directory would be wiped on every new deploy. The Django cloudinary_storage library acts as a drop-in replacement for Django’s default file storage, so all ImageField, FileField, and CloudinaryField instances transparently write to and read from your Cloudinary cloud.

Required Environment Variables

Set these three variables before starting the server. Without them, any page that attempts to render or upload media will raise an authentication error from the Cloudinary API.
CLOUDINARY_CLOUD_NAME
string
required
Your unique cloud identifier, shown in the top-left corner of the Cloudinary dashboard. Example: dxyz1234a.
CLOUDINARY_API_KEY
string
required
A numeric API key found in Settings → API Keys in the Cloudinary console. This key identifies your account in every SDK request.
CLOUDINARY_API_SECRET
string
required
The corresponding API secret for the key above. Treat this like a password — it authorizes uploads, transformations, and deletions. Click Reveal in the Cloudinary console to copy it.

Getting Your Credentials

1

Create or log in to Cloudinary

Go to cloudinary.com and sign up for a free account or log in.
2

Open the Dashboard

After logging in you land on the Dashboard. The Cloud Name is displayed prominently in the top section under your account name.
3

Find API credentials

Navigate to Settings → API Keys. Your API Key and API Secret are listed there. Click Reveal next to the secret if it is masked.
4

Add to your environment

Copy all three values into your .env file locally or into the Render Environment tab in production.

Django Configuration

The platform configures Cloudinary in namets/settings.py as follows. This block is already present — you only need to supply the environment variables.
import cloudinary
import cloudinary.uploader
import cloudinary.api

cloudinary.config(
    cloud_name=os.environ.get('CLOUDINARY_CLOUD_NAME'),
    api_key=os.environ.get('CLOUDINARY_API_KEY'),
    api_secret=os.environ.get('CLOUDINARY_API_SECRET'),
    secure=True,       # Force HTTPS for all image URLs
    access_mode='public'
)

CLOUDINARY_STORAGE = {
    'CLOUD_NAME': os.environ.get('CLOUDINARY_CLOUD_NAME'),
    'API_KEY': os.environ.get('CLOUDINARY_API_KEY'),
    'API_SECRET': os.environ.get('CLOUDINARY_API_SECRET'),
}

DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'
secure=True ensures every public URL generated by the SDK uses https://. Do not change this in production.

Cloudinary Folder Structure

Each Django app uploads files to a dedicated Cloudinary folder, keeping your media library organized. The table below maps every folder to the model that writes to it.
Cloudinary FolderApp / ModelContent
announcements/communications.AnnouncementAnnouncement banner images
events/events.EventEvent cover images
gallery/gallery.Gallery, gallery.GalleryImageGallery album covers and photos
materials/academics.CourseMaterialDownloadable academic course materials
user_resources/academics.UserResourceSubmissionFiles submitted by students for review
executives/community.ExecutiveExecutive member profile photos
patrons/community.PatronPatron profile images
developers/community.DeveloperDeveloper team photos
islamiyya_photos/academics.IslamiyyaRegistrationPassport photos for Islamiyya registration
namets_docs/community.NAMETSDocumentOfficial documents (constitution, reports)
magazine/covers/communications.MagazineMagazine issue cover images
magazine/pdfs/communications.MagazineMagazine issue PDF files
lostfound/lostfound.ItemLost-and-found item photos
In the Cloudinary Media Library, you can browse files by folder to quickly audit what has been uploaded for each section of the site.

Allowed File Types for Resource Submissions

When students submit files through the UserResourceSubmission form, the platform enforces a strict allowlist. Uploads with any other extension are rejected with a validation error before reaching Cloudinary.
Allowed extensions for UserResourceSubmission: pdf, doc, docx, jpg, jpeg, png, zip, pptx. All other formats are blocked by the model’s clean() method.
allowed = ['pdf', 'doc', 'docx', 'jpg', 'jpeg', 'png', 'zip', 'pptx']

Free Tier Limits

Cloudinary’s free plan provides 25 GB of managed storage and 25 GB of monthly bandwidth. For a student association platform with moderate traffic, the free tier is typically sufficient. Monitor usage in the Cloudinary dashboard under Usage → Storage & Bandwidth and upgrade if you approach the limits during high-activity periods such as application seasons or event announcements.

Build docs developers (and LLMs) love