Operations manual

Reference · 01

Environment variable reference

This page is the authoritative list of environment values read by the application. Values already exported by systemd or the shell win over the .env file.

ReferenceEnvironmentProductionReviewed November 2026

Core

VariableDefault / requirementNotes
DJANGO_SECRET_KEYRequired in production50+ characters, 5+ unique, no development prefix.
DJANGO_DEBUG1 local, forced false in productionNever enable on the VPS.
DJANGO_ALLOWED_HOSTSCanonical hostsComma-separated. Include www and optional short host.
DJANGO_CSRF_TRUSTED_ORIGINSCanonical HTTPS originsComma-separated full origins.
SITE_URLProduction must be httpsUsed in email and affiliate links.
SETUP_ENABLED0Browser setup wizard. Use the CLI or enable briefly for first run.
SHORTLINK_DOMAINBlankOptional subdomain of the site host.
ORDER_PREFIXPFZOrder number prefix.
PAYMENT_PROVIDERcodstripe, flutterwave, paypal or cod.

Database

VariableNotes
DB_ENGINEpostgresql on the VPS; sqlite for local production checks.
DB_NAME, DB_USER, DB_PASSWORDPostgreSQL credentials.
DB_HOST, DB_PORTDefault 127.0.0.1:5432.
DB_CONN_MAX_AGEDefault 600 seconds.
POSTGRES_DB, POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_HOST, POSTGRES_PORTLocal development alias; production prefers DB_*.

Security and HTTPS

VariableDefaultNotes
DJANGO_SECURE_SSL_REDIRECT1Health paths exempt.
SECURE_HSTS_SECONDS31536000One year.
ENABLE_HSTS_INCLUDE_SUBDOMAINS1Requires every subdomain to be HTTPS.
ENABLE_HSTS_PRELOAD1Only after you are ready for preload.

Email and newsletter

VariableNotes
DJANGO_EMAIL_BACKENDSMTP, console or provider backend.
DJANGO_EMAIL_HOST, DJANGO_EMAIL_PORTSMTP endpoint.
DJANGO_EMAIL_HOST_USER, DJANGO_EMAIL_HOST_PASSWORDSMTP credentials.
DJANGO_EMAIL_USE_TLS, DJANGO_EMAIL_USE_SSLOnly one may be enabled.
DEFAULT_FROM_EMAIL, SERVER_EMAILSender identity.
TRANSACTIONAL_EMAIL_PROVIDERsmtp, resend, sendgrid, postmark or mailgun.
RESEND_API_KEY, SENDGRID_API_KEY, POSTMARK_SERVER_TOKEN, MAILGUN_API_KEYOptional provider credentials.
NEWSLETTER_ESP, MAILCHIMP_API_KEY, MAILCHIMP_LIST_ID, MAILCHIMP_WEBHOOK_SECRETNewsletter sync.

Payments

VariableNotes
STRIPE_PUBLIC_KEY, STRIPE_SECRET_KEY, STRIPE_WEBHOOK_SECRETStripe Checkout and webhook verification.
FLW_CLIENT_ID, FLW_CLIENT_SECRET, FLW_ENCRYPTION_KEY, FLW_SECRET_HASHFlutterwave v4 credentials.
FLW_ENV, FLW_API_BASE, FLW_SCENARIO_KEYSandbox/production and optional base override.
PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PAYPAL_WEBHOOK_IDPayPal Orders v2 and webhook verification.
PAYPAL_ENV, PAYPAL_API_BASEsandbox/live and optional base override.

Social, AI and push

VariableNotes
GOOGLE_OAUTH_CLIENT_ID, GOOGLE_OAUTH_CLIENT_SECRETGoogle sign-in.
APPLE_OAUTH_CLIENT_ID, APPLE_OAUTH_TEAM_ID, APPLE_OAUTH_KEY_ID, APPLE_OAUTH_PRIVATE_KEYApple sign-in.
X_BEARER_TOKEN, LINKEDIN_ACCESS_TOKEN, LINKEDIN_AUTHOR_URNSocial publishing.
META_PAGE_ID, META_PAGE_ACCESS_TOKEN, INSTAGRAM_BUSINESS_ID, INSTAGRAM_ACCESS_TOKENMeta/Instagram.
PINTEREST_ACCESS_TOKEN, PINTEREST_BOARD_ID, TIKTOK_ACCESS_TOKENPinterest and TikTok.
AI_PROVIDER, OPENAI_API_KEY, OPENAI_MODELLocal or OpenAI assistant.
VAPID_PUBLIC_KEY, VAPID_PRIVATE_KEY, VAPID_SUBJECTBrowser push.
GA4_API_SECRET, META_CAPI_TOKENServer-side purchase events.

Media storage and CDN

VariableNotes
USE_S30 local disk; 1 S3 media/static.
AWS_USE_IAM_ROLEUse the instance/task role instead of static keys.
AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEYStatic credentials when an IAM role is not used.
AWS_STORAGE_BUCKET_NAME, AWS_S3_REGION_NAMEBucket and region.
AWS_S3_CUSTOM_DOMAINOptional CDN/custom domain; defaults to CloudFront when configured.
CLOUDFRONT_DOMAIN, CLOUDFRONT_DISTRIBUTION_IDCloudFront delivery host and invalidation distribution.
CLOUDFRONT_KEY_ID, CLOUDFRONT_PRIVATE_KEY_PATHOptional CloudFront signing key pair for signed public delivery; a literal CLOUDFRONT_PRIVATE_KEY is also accepted.
CLOUDFRONT_SIGNED_URLS, CLOUDFRONT_EXPIRATIONEnable signed delivery and set its lifetime.

Operations

VariableNotes
RATE_LIMITING_ENABLEDKeep 1 in production.
BACKUP_S3_BUCKETPrivate backup bucket; required for create_backup. No local fallback.
BACKUP_S3_PREFIX, BACKUP_S3_REGIONBackup object prefix and region.
BACKUP_S3_SSE, BACKUP_S3_KMS_KEY_IDServer-side encryption algorithm and optional KMS key.
BACKUP_KEEPNumber of backup sets retained in S3, default 14.
DJANGO_EMAIL_TIMEOUTSMTP timeout, default 20 seconds.

Values not listed here are derived, internal or documented on the integration page that owns them. The production template is deploy/env.production.example.

Perfumz Operations Manual · English reference · Reviewed November 2026