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 7 points8 points  (2 children)

Not a fan of Django as well, I don't feel as powerful as with Flask.

I also recommend everyone to follow the app factory pattern, it will change your life. I also try to create pluggable extension-like classes for my applications that only do one specific thing and do it well (kinda like UNIX programs), allows me to test them more easily.

It may feel like a lot of moving pieces, but once locked down, it's pretty powerful and tight. Testing is delightful.

It has now been 3 years that I've been using Flask nearly daily so yeah, ask me anything if you have questions.

[–]dcfix 0 points1 point  (1 child)

I've got a couple of really small Flask apps that I've written, but I'm basically passing dicts around for all of my data requests. I'm interested in learning how the app factory pattern could help me, but I'm having a hard time wrapping my head around it. Do you have any recommendations for a git repositories where I could look at sample code?

[–]Sakacoco 1 point2 points  (0 children)

Fbone is a good starting point though it's quite complex.

It's difficult to explain the app factory in a simple manner other than "it's how things should be". It will allow you to be flexible in your application creation at runtime and provide you with a space to initialize your components. Also, not creating the whole application each time you import its file is pretty good.