ENV=productionSECRET_KEYDATABASE_URLALLOWED_HOSTSPUBLIC_BASE_URLCRON_TOKENONE_NCE_BASE_URLONE_NCE_AUTH_HEADERMERCADOPAGO_ACCESS_TOKENMERCADOPAGO_CLIENT_IDMERCADOPAGO_CLIENT_SECRETMERCADOPAGO_REDIRECT_URIMERCADOPAGO_WEBHOOK_TOKEN
Optional but recommended:
CSRF_TRUSTED_ORIGINSMERCADOPAGO_WEBHOOK_URLONE_NCE_AUTH_URLSECURE_SSL_REDIRECTSECURE_HSTS_SECONDSLOGIN_RATE_LIMIT_FAILURESLOGIN_RATE_LIMIT_WINDOW_SECONDSLOGIN_RATE_LIMIT_LOCKOUT_SECONDS
- Set
ALLOWED_HOSTSexplicitly for every public hostname. - Set
PUBLIC_BASE_URLto the canonical HTTPS origin. - Terminate TLS correctly at the proxy and forward
X-Forwarded-Proto. - Keep
ENV=productionin every production process. - Run
python manage.py check --deploybefore release. - Verify Mercado Pago webhook token and 1NCE credentials after each deploy.
- Use a shared cache backend in production if the app runs on more than one instance so login rate limiting applies consistently.
- Rotate
SECRET_KEYonly with a coordinated session invalidation window. - Rotate
CRON_TOKEN,MERCADOPAGO_WEBHOOK_TOKEN,MERCADOPAGO_ACCESS_TOKEN, andONE_NCE_AUTH_HEADERon a schedule and immediately after any suspected leak. - Store production secrets only in the deployment platform secret manager or environment configuration.
- Never commit
.envfiles with real secrets.
- Revoke exposed tokens and rotate affected credentials.
- Review
auditlogs_systemlogentries for:- failed logins
- login rate limit events
- unauthorized user management attempts
- unauthorized SIM access attempts
- webhook rejections
- Verify whether unauthorized state changes or assignments were applied before the fix.
- Re-run targeted authorization tests before restoring normal access.