4 ms·
I appreciate the suggestions. Since it's something I'll want to consider writing about, why are you interested in the "by hand" integrations rather than using t
by rpicard 13y ago
I appreciate the suggestions. Since it's something I'll want to consider writing about, why are you interested in the "by hand" integrations rather than using the Flask plugins?
- bsaul 13y agoBecause you really need to understand how things work to debug them sometimes. Personal example : flask-sqlalchemy binds the session lifecycle to the flask request lifecycle. 1 session <-> 1 request. Now i've got celery tasks, and they're also using sqlalchemy, and all of the sudden, my celery tasks running on the same thread seem to keep the same session object for different tasks. One solution (IIRC) was to create a new "fake" request context for each task, and then let sqlalchemy session bind to that fake request. If i just plugged the flask-sqlalchemy module, i wouldn't have even known about session scopes, and would have looked at the celery bug with a blank stare. Since flask is a micro framework it lets you customize those kind of things. But more importantly, it lets you LEARN about the issues in the first place. I think that's one of the major benefits of dealing with micro frameworks.
- rpicard 13y agoThat's very interesting. I'm making a note of this for inclusion in the book.