TrustRide reads all sensitive configuration from environment variables using Python’sDocumentation 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.
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.| Variable | Default | Description |
|---|---|---|
DJANGO_SECRET_KEY | (none — required) | Django secret key used for signing sessions, CSRF tokens, and password reset links. |
DJANGO_DEBUG | True | Boolean string. Must be False in production. |
ALLOWED_HOSTS | trustride.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. |
Database
TrustRide usesdj-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.
| Variable | Default | Description |
|---|---|---|
DATABASE_URL | SQLite fallback | Full PostgreSQL connection string. Takes precedence over all other DB vars. |
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 toInMemoryChannelLayer in settings), the same Redis instance handles Django Channels as well.
| Variable | Default | Description |
|---|---|---|
CELERY_BROKER_URL | redis://localhost:6379 | Celery message broker URL. |
CELERY_RESULT_BACKEND | redis://localhost:6379 | Where Celery stores task results. |
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).settings.py is smtp-relay.brevo.com (Brevo / Sendinblue), but any SMTP provider works.
| Variable | Default | Description |
|---|---|---|
EMAIL_HOST | smtp-relay.brevo.com | SMTP server hostname. |
EMAIL_PORT | 587 | SMTP port (587 for STARTTLS, 465 for SSL). |
EMAIL_USE_TLS | True | Enable 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_EMAIL | Trustride <Trustride2026@gmail.com> | Sender address shown in all outgoing emails. |
Paystack — Payments
TrustRide integrates with Paystack for Nigerian naira payment processing.| Variable | Description |
|---|---|
PAYSTACK_PUBLIC_KEY | Paystack publishable key (used client-side). |
PAYSTACK_SECRET_KEY | Paystack secret key (used server-side to verify webhooks and initiate charges). |
Security Settings
These variables control Django’s production security headers. All are ignored whenDJANGO_DEBUG=True — they only take effect in production mode.
| Variable | Default (production) | Description |
|---|---|---|
CSRF_TRUSTED_ORIGINS | https://trustride.ng,https://www.trustride.ng | Comma-separated list of full origin URLs that are allowed to make cross-site POST requests. Must include your domain with the scheme. |
CORS_ALLOWED_ORIGINS | http://127.0.0.1:8000,http://localhost:8000 | Origins allowed by django-cors-headers. Update for any frontend app on a separate domain. |
SECURE_SSL_REDIRECT | True | Redirect 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_SECURE | True | Send the session cookie only over HTTPS. |
CSRF_COOKIE_SECURE | True | Send the CSRF cookie only over HTTPS. |
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.