Why I Chose to Build my Portfolio Site with Flask

My background in development has been an interesting patchwork. My initial experience in the field came with me learning Front End to help a buddy build a travel blog. He chose to build in Wordpress and so I picked up PHP and got to work.

(It loads slow. Don't judge. I've learned so much since then.)

Eventually, I learned enough about development and was approached by my boss to get certified to teach Java at the high school that I work at. This led to an interesting path for me: I was learning a back-end language at the same time that I was working on my Front-End skills.

Over Summer 2018 (I have summers off for the most part), I concentrated my learning in trying connect my knowledge and learn Full-Stack. I was introduced to Flask in the process while learning to write a CRUD application. I loved that the framework was so intuitive and readable and I felt like I might have a shot to learn it. The ability to run your site through localhost almost right-out-of-the-box made things convenient as well. I felt like if I learned a micro-framework that I would stand a chance at learning something like React or Angular in the future.

The framework was a bit daunting at first, as it was completely in Python. I can read and interpret Python easily and had dabbled a bit in the language. However, the idea of writing my own HTTP requests in the language was certainly scary. I wavered for days before deciding to take the plunge and make it happen.

Spiderman Taking a "Leap of Faith"
It Takes a Leap of Faith

With heavy help from Miguel Grinberg's "The Flask Mega-Tutorial", I was able to get going. Miguel's tutorial is some truly pro stuff. Still, the first few days were daunting, as I felt like I could follow Miguel, but couldn't do much on my own. That's when I decided to go rogue.

Running from an explosion (Star Wars: Rogue Squandron)
Go Rogue
I scaled back to a very early version of Miguel's build and started to add totally new and original features. My new direction saw Miguel and I part ways from a blog to a portfolio. I started with some hand drawn sketches in my notebook and began to translate those into HTML and CSS. I made it easily through the HTML and CSS (I had never used a framework before, so I'm really good at Vanilla HTML and CSS). I started to see some progress and felt bulletproof for bit. I was learning a ton of stuff and it was actually working.

The database slowed me down. Flask makes writing database code a breeze, as the code is super-readable and very intuitive. However, I was unaware that the SQLite DB that I was using wouldn't work in production. I had decided to host on Heroku, and due to Heroku's ephemeral file system, I had to switch to their PostgreSQL DB(Miguel covers this in his tutorial). It took me way too long to figure out that Flask makes this easy, too.

Flask uses a tool called SQLAlchemy to automatically recognize DB changes so that you can easily migrate those changes into production. Once I go this step down, I had a method of production down:

Design a feature. Mark it up. Make it functional. Make it pretty. Test the feature. Migrate the changes. Push to Production.

Flask is not the best tool in the world, but it has more than met my needs and is working brilliantly for my portfolio site.

This process has taught me a ton to move forward with: how to design and develop in an iterative way, how to think about data and it's storage in a database, and how to craft HTTP requests are some of the big take-aways. 

I think Flask is a perfect way to get code newbies like myself into the industry and make things make sense. I am continuing to work on my site as I learn new technologies. I am getting down the basics of Javascript now to accomplish my next goal of learning React. React is very different from Flask, but I have already seen a ton of carryover in my studies!