.env file in your project root using python-dotenv.
Core Settings
Secret key for session encryption and CSRF protection.If not set, the application will generate a random key using
os.urandom(24), but this will change on every restart.Example:Environment Detection
The platform supports multiple ways to indicate the running environment. Any of these variables can be used:Flask environment mode.Options:
development- Development mode with debug enabledtesting- Testing mode with in-memory databaseproduction- Production mode with security hardening
Alternative environment indicator. Use if your deployment platform sets this instead of
FLASK_ENV.Options: development, testing, productionExample:Short-form environment indicator.Options:
dev- Developmentprod- Production
The application is considered to be in production mode if any of these conditions are met:
FLASK_ENV=productionAPP_ENVIRONMENT=productionENV=prod
Logging Configuration
Enable logging to standard output instead of file-based logging.Set to When
true when deploying to platforms that capture stdout (like Heroku, Docker, or Kubernetes).Example:false, logs are written to app.log in the project root.File Upload Settings
Directory for user-uploaded files (PDFs, images, etc.).The default location is
This is set automatically by the configuration class and typically doesn’t need to be overridden.
app/static/uploads relative to the project root.Complete Example
Here’s a complete.env file example:
Configuration Class Reference
The platform uses different configuration classes based on the environment:| Environment | Debug | Database | CSP unsafe-eval | Rate Limiting | CSRF |
|---|---|---|---|---|---|
| Development | Enabled | PostgreSQL or SQLite | Allowed | Enabled | Enabled |
| Testing | Disabled | In-memory SQLite | Allowed | Disabled | Disabled |
| Production | Disabled | PostgreSQL (recommended) | Blocked | Enabled | Enabled |
Next Steps
Database Configuration
Configure PostgreSQL or SQLite database connections
Security Settings
Learn about CSP, Talisman, and rate limiting configuration