nf1s / fastapi_sqlalchemy_alembic

Simple implementation for Fastapi with a relational database and migrations
54 stars 26 forks source link

Environment variable configuration should leverage pydantic.BaseConfig #2

Open skewty opened 4 years ago

skewty commented 4 years ago

https://github.com/ahmednafies/fastapi_sqlalchemy_alembic/blob/c97cca7438faaf20bddf7451f34561b193fdf57f/main.py#L16

The more appropriate way to refer to configuration in environment in FastAPI is via pydantic.BaseConfig. If I am not mistaken that is how FastAPI does things for itself.

nf1s commented 4 years ago

ohh that is new, I did not know that. thank very much for sharing :)