superlinear-ai / poetry-cookiecutter

🍪 Poetry Cookiecutter is a modern Cookiecutter template for scaffolding Python packages and apps
GNU Affero General Public License v3.0
252 stars 37 forks source link

Replace `FastAPI.on_event` by `lifespan` event handler in API template #226

Closed vanolucas closed 7 months ago

vanolucas commented 7 months ago

Alternative events are now deprecated in FastAPI.

i.e., the method on_event in class FastAPI is deprecated. lifespan event handlers should be used instead.

on_event is used in the FastAPI template in api.py.

Thanks for this great template!

lsorber commented 7 months ago

Already done in #222!

lsorber commented 7 months ago

We just merged #222, so I'll go ahead and close this. Thanks for posting this though!