This January, I spent two weeks wrestling with Flask and SQLAlchemy. In order for them to play nice together, you have to follow specific rules - rules that I spent two weeks figuring out and experimenting with. Fortunately, going down the rabbit hole was well worth it and I emerged a stronger, more confident programmer. I also emerged with two projects that I’m rather proud of. Let me tell you about them:
First, I published a Python project called Flask-SQLAlchemy-bind. It’s kind of a knock-off much simpler version of Flask-SQLAlchemy. The key is it works and follows all the specifications of both Flask and SQLAlchemy. Check it out on PyPi or install it using `pip install flask-sqlalchemy-bind`.
Second, I published a blog post on Medium titled “Under the Hood of Flask-SQLAlchemy.” The blog post explains how to add support for SQLAlchemy to your Flask app without the use of a third-party plugin. There aren’t many (if any?) tutorials out there so this is my attempt to bridge the gap and save the next man in line some effort and confusion.
Here’s an overview of what you’ll find in the post:
I’m extremely proud of this post—it took a lot of effort to distill my new-found knowledge into something readable. Figuring out how to pull an explanation from my brain and get it down on paper in a concise manner felt like pulling taffy.
Feedback is appreciated, I know I still have a lot to learn.