Skip to main content

Documentation Index

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

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

TrustRide reads all sensitive configuration from environment variables using Python’s python-dotenv library. On startup, settings.py calls load_dotenv(BASE_DIR / '.env'), so you can place a .env file in the project root for local development or inject variables directly into the environment for production deployments. This page documents every supported variable, its expected format, and its default value where one exists.
Variable names in settings.py use os.getenv() directly. There is no django-environ or decouple layer — plain KEY=VALUE syntax in your .env file is all that is required.

Core Django Settings

DJANGO_SECRET_KEY

Django’s cryptographic signing key. Required in production. Never commit this value to source control.

DJANGO_DEBUG

Set to True for local development and False for all production and staging environments. Defaults to True if unset.
VariableDefaultDescription
DJANGO_SECRET_KEY(none — required)Django secret key used for signing sessions, CSRF tokens, and password reset links.
DJANGO_DEBUGTrueBoolean string. Must be False in production.
ALLOWED_HOSTStrustride.ng,www.trustride.ng (when DEBUG=False)Comma-separated list of hostnames Django will respond to. Example: trustride.ng,www.trustride.ng.
DJANGO_SETTINGS_MODULE(set in manage.py)Module path for settings. Set to trust_ride.settings unless you add environment-specific settings files.
Generate a secure secret key with:
python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"

Database

TrustRide uses dj-database-url to parse a single connection string. If DATABASE_URL is not set, the app falls back to a local SQLite file (db.sqlite3) — only acceptable for development.
VariableDefaultDescription
DATABASE_URLSQLite fallbackFull PostgreSQL connection string. Takes precedence over all other DB vars.
Connection string format:
DATABASE_URL=postgres://USER:PASSWORD@HOST:PORT/DBNAME
Example:
DATABASE_URL=postgres://trustride:s3cur3p@ss@localhost:5432/trustride
The dj-database-url configuration in settings.py sets conn_max_age=600 (persistent connections) and ssl_require=False. Enable SSL by appending ?sslmode=require to the URL when connecting to a hosted PostgreSQL service.

Redis

Redis serves as the Celery task broker and result backend. If you enable the Redis channel layer (currently set to InMemoryChannelLayer in settings), the same Redis instance handles Django Channels as well.
VariableDefaultDescription
CELERY_BROKER_URLredis://localhost:6379Celery message broker URL.
CELERY_RESULT_BACKENDredis://localhost:6379Where Celery stores task results.
Example (remote Redis / Redis Cloud):
CELERY_BROKER_URL=redis://:your-redis-password@redis.example.com:6379/0
CELERY_RESULT_BACKEND=redis://:your-redis-password@redis.example.com:6379/0
To switch to the Redis channel layer for Django Channels (recommended for multi-process deployments), update CHANNEL_LAYERS in settings.py and point it at the same CELERY_BROKER_URL or a dedicated Redis database index (e.g. /1).

Email

TrustRide sends transactional emails for booking confirmations, cancellations, waitlist alerts, and ride reminders. The default SMTP host in settings.py is smtp-relay.brevo.com (Brevo / Sendinblue), but any SMTP provider works.
VariableDefaultDescription
EMAIL_HOSTsmtp-relay.brevo.comSMTP server hostname.
EMAIL_PORT587SMTP port (587 for STARTTLS, 465 for SSL).
EMAIL_USE_TLSTrueEnable STARTTLS negotiation. Set False only for port 465 SMTPS.
EMAIL_HOST_USER(empty)SMTP login username (often your full email address or an API login).
EMAIL_HOST_PASSWORD(empty)SMTP password or API key.
DEFAULT_FROM_EMAILTrustride <Trustride2026@gmail.com>Sender address shown in all outgoing emails.
Gmail example (app password required):
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=you@gmail.com
EMAIL_HOST_PASSWORD=your-16-char-app-password
DEFAULT_FROM_EMAIL=TrustRide <you@gmail.com>

Paystack — Payments

TrustRide integrates with Paystack for Nigerian naira payment processing.
VariableDescription
PAYSTACK_PUBLIC_KEYPaystack publishable key (used client-side).
PAYSTACK_SECRET_KEYPaystack secret key (used server-side to verify webhooks and initiate charges).
Use your test keys during development and swap to live keys only in production.

Security Settings

These variables control Django’s production security headers. All are ignored when DJANGO_DEBUG=True — they only take effect in production mode.
VariableDefault (production)Description
CSRF_TRUSTED_ORIGINShttps://trustride.ng,https://www.trustride.ngComma-separated list of full origin URLs that are allowed to make cross-site POST requests. Must include your domain with the scheme.
CORS_ALLOWED_ORIGINShttp://127.0.0.1:8000,http://localhost:8000Origins allowed by django-cors-headers. Update for any frontend app on a separate domain.
SECURE_SSL_REDIRECTTrueRedirect all HTTP requests to HTTPS. Set to False if SSL termination happens upstream (e.g. at a load balancer) and SECURE_PROXY_SSL_HEADER is set.
SESSION_COOKIE_SECURETrueSend the session cookie only over HTTPS.
CSRF_COOKIE_SECURETrueSend the CSRF cookie only over HTTPS.
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') is always active in settings.py. When sitting behind Nginx, ensure Nginx sets the X-Forwarded-Proto: https header, otherwise Django will not recognise requests as secure even after SSL termination.

Sample .env File

Copy this template to the project root, fill in the real values, and restrict file permissions so only the trustride system user can read it.
# ── Django ─────────────────────────────────────────────────────────────────
DJANGO_SECRET_KEY=your-secret-key-here
DJANGO_DEBUG=False
ALLOWED_HOSTS=yourdomain.com,www.yourdomain.com
CSRF_TRUSTED_ORIGINS=https://yourdomain.com,https://www.yourdomain.com
CORS_ALLOWED_ORIGINS=https://yourdomain.com

# ── Database (PostgreSQL) ───────────────────────────────────────────────────
DATABASE_URL=postgres://trustride:password@localhost:5432/trustride

# ── Redis / Celery ──────────────────────────────────────────────────────────
CELERY_BROKER_URL=redis://localhost:6379/0
CELERY_RESULT_BACKEND=redis://localhost:6379/0

# ── Email (Brevo / Sendinblue) ──────────────────────────────────────────────
EMAIL_HOST=smtp-relay.brevo.com
EMAIL_PORT=587
EMAIL_USE_TLS=True
EMAIL_HOST_USER=your-brevo-login@smtp-brevo.com
EMAIL_HOST_PASSWORD=your-brevo-smtp-key
DEFAULT_FROM_EMAIL=TrustRide <no-reply@yourdomain.com>

# ── Paystack ────────────────────────────────────────────────────────────────
PAYSTACK_PUBLIC_KEY=pk_live_xxxxxxxxxxxxxxxxxxxx
PAYSTACK_SECRET_KEY=sk_live_xxxxxxxxxxxxxxxxxxxx

# ── Security (production only) ──────────────────────────────────────────────
SECURE_SSL_REDIRECT=True
SESSION_COOKIE_SECURE=True
CSRF_COOKIE_SECURE=True
Restrict file permissions after creating the file:
chmod 600 /opt/trustride/app/.env
chown trustride:trustride /opt/trustride/app/.env

Build docs developers (and LLMs) love