Skip to main content
Every BackAnt project ships with a .env file at the project root. This file is loaded at startup by python-dotenv and mapped to the Environment class in api/startup/Environment.py.

Default .env

Never commit real credentials to version control. Add .env to .gitignore and use secrets management in production.

Database variables

DB_URL should be set to postgres when running inside Docker Compose (the service name resolves as a hostname), and localhost when running Flask directly outside of Docker.
Set CLEAR_DB=True only during development. It drops all tables on every restart.

Flask variables

AWS / S3 variables

These are used by the built-in AWSClient in api/apis/aws/AWSClient.py.

AWS Cognito variables

Used when integrating Cognito for authentication.

Environment class

All variables are accessed at runtime via the myEnvironment singleton in api/startup/Environment.py. Never read os.environ directly — import from the singleton instead:

Local development without Docker

Set DB_URL=localhost and ensure PostgreSQL is running locally:
Then run Flask directly: