We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a poetry project, i call config file from main file and value vars are empty, values from .env file are not read
What's my mistake ?
pydantic-test ├── pydantic_test │ └── config.py │ └── main.py │ └── .env │ └── __init__.py └── tests │ └── __init__.py └── pyproject.toml
from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): DRIVER: str = 'postgresql' USERNAME: str = '' PASSWORD: str = '' HOST: str = '' PORT: int = 5432 DATABASE: str = '' SQLALCHEMY_DATABASE_URL: str = f"{DRIVER}://{USERNAME}:{PASSWORD}@{HOST}:{PORT}/{DATABASE}" model_config = SettingsConfigDict( env_file='.env', env_file_encoding='utf-8', extra='ignore', case_sensitive=True, ) settings = Settings()
pydantic version: 2.4.2 pydantic-core version: 2.10.1 pydantic-core build: profile=release pgo=false install path: /Users/juan/Library/Caches/pypoetry/virtualenvs/pydantic-test-K3b8D-bR-py3.10/lib/python3.10/site-packages/pydantic python version: 3.10.6 (v3.10.6:9c7b4bd164, Aug 1 2022, 17:13:48) [Clang 13.0.0 (clang-1300.0.29.30)] platform: macOS-14.0-arm64-arm-64bit related packages: typing_extensions-4.8.0 pydantic-settings-2.0.3
The text was updated successfully, but these errors were encountered:
samuelcolvin
No branches or pull requests
Initial Checks
Description
I have a poetry project, i call config file from main file and value vars are empty, values from .env file are not read
What's my mistake ?
Example Code
Python, Pydantic & OS Version
The text was updated successfully, but these errors were encountered: