florimondmanca / www

Code for https://florimond.dev
MIT License
32 stars 10 forks source link

Structuring Starlette Projects #147

Open utterances-bot opened 3 years ago

utterances-bot commented 3 years ago

Structuring Starlette Projects

Starlette's modular design doesn't necessarily make it clear how Starlette projects should be structured. Here is a minimal yet flexible project structure that will prevent circular dependencies and help you write more readable Starlette application code.

https://florimond.dev/blog/articles/2020/05/structuring-starlette-projects/

magiskboy commented 3 years ago

nice, it's useful for me

vgavro commented 3 years ago

This article encourages to use singleton objects (app and .resources) instead of factories with storing state on application, which is considered as bad design by many programmers, I think you should add disclaimer about that - some newbies may consider this as "best practice". There is no way on writing reusable python module which will rely on .resources or .settings because of this, and there is no way to run several applications with different configurations in same context.

dejurin commented 2 years ago

How about cache for database?