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 NAMETS Website ships with a render.yaml Infrastructure-as-Code file that defines everything Render needs to build and run the application — including the runtime, build commands, start command, and environment variable declarations. Deploying is as straightforward as connecting your GitHub repository to Render and letting the platform execute the pre-configured pipeline. The production stack uses Neon (serverless PostgreSQL) for the database, Cloudinary for media file storage, and WhiteNoise for efficient static file serving directly from Gunicorn — no separate file server required.

render.yaml Configuration

The render.yaml at the repository root declares a single web service named namets. Review it before your first deploy to understand exactly what Render will do:
services:
  - type: web
    name: namets
    runtime: python
    plan: free
    buildCommand: |
      curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
      export PATH="$HOME/.cargo/bin:$PATH"
      pip install -r requirements.txt
      python manage.py collectstatic --noinput
      python manage.py migrate
    startCommand: gunicorn namets.wsgi:application --workers 2 --log-level info
    envVars:
      - key: SECRET_KEY
        generateValue: true
      - key: DEBUG
        value: false
      - key: ALLOWED_HOSTS
        value: .onrender.com
      - key: DATABASE_URL
        sync: false
      - key: CLOUDINARY_CLOUD_NAME
        sync: false
      - key: CLOUDINARY_API_KEY
        sync: false
      - key: CLOUDINARY_API_SECRET
        sync: false
      - key: N8N_WEBHOOK_URL
        value: https://n8n-render-5s6o.onrender.com/webhook/namets-events
      - key: WEBHOOK_SECRET
        sync: false

Build Command

The build phase installs Rust (required by some cryptographic dependencies), installs all Python packages, collects static files, and runs database migrations — in that order:
# 1. Install Rust toolchain (required by some dependencies)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
export PATH="$HOME/.cargo/bin:$PATH"

# 2. Install Python dependencies
pip install -r requirements.txt

# 3. Collect and compress static assets via WhiteNoise
python manage.py collectstatic --noinput

# 4. Apply all database migrations
python manage.py migrate

Start Command

Render starts the application using Gunicorn with 2 worker processes and informational log output:
gunicorn namets.wsgi:application --workers 2 --log-level info
The Procfile in the repository root uses 4 workers (--workers 4) and is kept for compatibility with other Procfile-aware platforms. Render uses render.yaml’s startCommand exclusively and ignores the Procfile.

Python Version

The runtime.txt file pins the Python version for Render:
python-3.12
Render reads this file automatically and provisions the correct Python interpreter during the build.

Setting Environment Variables

Several environment variables are marked sync: false in render.yaml, meaning you must supply their values manually in the Render dashboard under Environment → Environment Variables before the first deploy succeeds.
VariableSourceDescription
SECRET_KEYAuto-generated by RenderLong random string — Render sets this automatically via generateValue: true
DEBUGrender.yaml defaultSet to false — do not change this in production
ALLOWED_HOSTSrender.yaml defaultSet to .onrender.com to allow all Render subdomains
DATABASE_URLNeon dashboardFull PostgreSQL connection string from your Neon project
CLOUDINARY_CLOUD_NAMECloudinary dashboardYour Cloudinary account cloud name
CLOUDINARY_API_KEYCloudinary dashboardAPI key for authenticated media uploads
CLOUDINARY_API_SECRETCloudinary dashboardAPI secret — treat this like a password
N8N_WEBHOOK_URLn8n instanceWebhook endpoint for event automation notifications
WEBHOOK_SECRETCustom valueShared secret used to validate webhook payloads

Setting Up Neon PostgreSQL

Neon provides a serverless PostgreSQL database with a free tier well-suited for the NAMETS platform. After creating a Neon project:
  1. Navigate to your project’s Connection Details panel.
  2. Copy the Connection String (it begins with postgresql://).
  3. Paste it as the value of DATABASE_URL in your Render environment variables.
The settings.py uses dj-database-url to parse this connection string automatically:
import dj_database_url

DATABASES = {
    'default': dj_database_url.config(default=os.environ.get('DATABASE_URL'))
}

Setting Up Cloudinary

All user-uploaded media (gallery images, event banners, etc.) are stored in Cloudinary under the namets/ default folder. To configure:
  1. Sign in to your Cloudinary Console.
  2. Copy the Cloud Name, API Key, and API Secret from the dashboard.
  3. Set CLOUDINARY_CLOUD_NAME, CLOUDINARY_API_KEY, and CLOUDINARY_API_SECRET in Render.
The settings.py configures Cloudinary storage as the default media backend:
DEFAULT_FILE_STORAGE = 'cloudinary_storage.storage.MediaCloudinaryStorage'

CLOUDINARY_STORAGE = {
    'DEFAULT_FOLDER': 'namets',
}

Static File Serving with WhiteNoise

The platform uses WhiteNoise to serve compressed and fingerprinted static files directly from Gunicorn — no CDN or separate static server is needed. WhiteNoise is wired in at two points in settings.py: Middleware (must appear directly after SecurityMiddleware):
MIDDLEWARE = [
    'django.middleware.security.SecurityMiddleware',
    'whitenoise.middleware.WhiteNoiseMiddleware',  # ← serves static files
    ...
]
Storage backend (enables compression and long-term caching via content hashes):
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
The python manage.py collectstatic --noinput step in the build command populates the staticfiles/ directory that WhiteNoise reads from at runtime.
Always set DEBUG=false in your Render environment. Running with DEBUG=True in production exposes full stack traces, internal settings, and source code snippets to anyone who triggers an error — this is a critical security risk. The render.yaml already sets DEBUG: false by default; do not override it.

Build docs developers (and LLMs) love