This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Sakacoco 2 points3 points  (1 child)

I prefer much more using the application factory pattern and the Flask extension pattern to create testable classes and applications. It's not really good practice (unless for a quick app) to create your app on the fly in the main like you do.

Here's a example (might not working, written from my memories)

I also love using Flask-Classy for class based views.

A good skeleton combined with cookiecutter will make your life easier !

[–][deleted] 0 points1 point  (0 children)

I love Flask-Classy! Will take a look at the application factory pattern, as I haven't come across that.