Configuration Reference
Generated projects use pydantic-settings and read values from .env.
Start from:
cp .env.example .env
Application
| Setting | Default | Purpose |
|---|---|---|
APP_NAME |
project name | FastAPI title and status service name |
APP_ENV |
development |
Runtime environment label |
APP_DEBUG |
true |
FastAPI debug mode |
API_V1_PREFIX |
/api/v1 |
Prefix for the generated API router |
Database
| Setting | Default | Purpose |
|---|---|---|
DATABASE_URL |
sqlite:///./poleposition.db |
SQLAlchemy database URL |
POSTGRES_DB |
app |
Local Docker PostgreSQL database |
POSTGRES_USER |
postgres |
Local Docker PostgreSQL user |
POSTGRES_PASSWORD |
postgres |
Local Docker PostgreSQL password |
POSTGRES_PORT |
5432 |
Host port for local Docker PostgreSQL |
Use Alembic for schema changes:
polepos db revision -m "add customers table"
polepos db upgrade
Runtime
| Setting | Default | Purpose |
|---|---|---|
APP_HOST |
127.0.0.1 |
Host passed to Uvicorn |
APP_PORT |
8000 |
Port passed to Uvicorn |
APP_RELOAD |
true |
Uvicorn reload mode |
UVICORN_WORKERS |
1 |
Worker process count |
UVICORN_ACCESS_LOG |
true |
Uvicorn access log toggle |
UVICORN_PROXY_HEADERS |
true |
Trust proxy headers |
UVICORN_FORWARDED_ALLOW_IPS |
127.0.0.1 |
Allowed proxy IPs |
UVICORN_SERVER_HEADER |
true |
Emit server header |
UVICORN_DATE_HEADER |
true |
Emit date header |
UVICORN_TIMEOUT_KEEP_ALIVE |
5 |
Keep-alive timeout |
UVICORN_BACKLOG |
2048 |
Socket backlog |
Optional integer or boolean-like values can be left commented in .env.example
until needed.
Logging
| Setting | Default | Purpose |
|---|---|---|
LOG_LEVEL |
INFO |
Python logging level |
LOG_FORMAT |
text |
text or json |
Use json for structured production logs:
LOG_FORMAT=json
CORS
| Setting | Default | Purpose |
|---|---|---|
CORS_ENABLED |
true |
Enable FastAPI CORS middleware |
CORS_ALLOW_ORIGINS |
local frontend origins | Allowed origins |
CORS_ALLOW_ORIGIN_REGEX |
empty | Optional origin regex |
CORS_ALLOW_CREDENTIALS |
true |
Allow credentials |
CORS_ALLOW_METHODS |
common HTTP methods | Allowed methods |
CORS_ALLOW_HEADERS |
auth and content headers | Allowed headers |
CORS_EXPOSE_HEADERS |
X-Request-ID |
Exposed response headers |
CORS_MAX_AGE |
600 |
Browser preflight cache seconds |
List settings accept JSON arrays:
CORS_ALLOW_ORIGINS=["https://app.example.com"]
Authentication
| Setting | Default | Purpose |
|---|---|---|
AUTH_SECRET_KEY |
change-me-in-production |
JWT signing secret |
AUTH_ALGORITHM |
HS256 |
JWT algorithm |
AUTH_ACCESS_TOKEN_EXPIRE_MINUTES |
60 |
Access token lifetime |
AUTH_ISSUER |
project name | Expected JWT issuer |
Change AUTH_SECRET_KEY before deployment.
Kafka
Kafka settings are added by:
polepos add integration kafka
Important values:
KAFKA_ENABLEDKAFKA_BOOTSTRAP_SERVERSKAFKA_CLIENT_IDKAFKA_DEFAULT_TOPICKAFKA_GROUP_IDKAFKA_REQUEST_TIMEOUT_MS
RabbitMQ
RabbitMQ settings are added by:
polepos add integration rabbitmq
Important values:
RABBITMQ_ENABLEDRABBITMQ_URLRABBITMQ_CLIENT_IDRABBITMQ_EXCHANGERABBITMQ_DEFAULT_ROUTING_KEYRABBITMQ_DEFAULT_QUEUERABBITMQ_PREFETCH_COUNT
LLM
LLM settings are added when an AI prompt module is generated:
polepos add module assistant --template ai-prompt
Important values:
LLM_PROVIDERLLM_MODELLLM_API_KEYLLM_BASE_URLLLM_TIMEOUT_SECONDSLLM_TEMPERATURELLM_MAX_TOKENS