With every web app there comes a time when you will need to serve up some static files. Maybe it is the JS or image files, or maybe you are just trying something out. Let’s talk about how to handle this in Flask.
Over the last few years I have wound up using mongo as my data store on several projects. In fact, it has been a while since I have written any SQL! For my latest project I again reached for mongo to hold my data, but this time I decided to use the Python minimongo project as my ODM (Object Document Mapper).
What is minimongo?
The greatest waste of time ever invented by humankind is sitting in traffic.
Think about it. You are literally just sitting. There are very few things you can realistically do other than just sit. Talking on the phone is possible, but who wants to talk to someone who is stressed because of their sitting in traffic? Reading, exercise, playing… all of these things are unavailable to you because you have to wait for the person in front of you to move up a half a car length.
One day as I found myself sitting in this situation, I had an inspiration about how I could turn this to my advantage. I would try my hand at video blogging.
After a quick MVP video or two, I invested the $20 in getting a phone holder. Now when I get stuck in a traffic jam I hit the record button and bust out “traffic thoughts”.
My thinking is that I just pick a topic (usually inspired by a podcast I just listened to or something I’ve read recently) and just go for it.
I have no real set objective for this experiment. I record them when I hit traffic, and then I’m speaking I try to just go from the gut. When I get home I upload the videos to YouTube and do some minimal editing of the description.
Things I’ve learned while doing this:
- Having a list of ideas (usually just a word or phrase) is absolutely necessary. If nothing else, it will keep you from repeating yourself.
- As soon as you want to record something, traffic seems to disappear. I wish I understood this phenomenon. 🙂
- You might think you could rant for hours about a topic. I have found that if I talk for more than 2 minutes that I feel less confident about my stance on the topic.
- Its an interesting way to pass the time when you are literally sitting in traffic.
Be sure to check out my play list with all of these videos: Traffic Thoughts
Recently a friend asked about where to find some employees for a company she is working at. Some others had suggested the usual job sites, but when I looked at them and had a flash of insight: These are jobs, but will she find the right people there? Where do the good developer look for new jobs? How do you find a development job you will love? Lets investigate!
The usual job sites will get you the usual results. To get extraordinary results, you need to work outside of the box a little bit.
Where the wild things are
People like to hang out with people like them. This fact can lead to bad things, but it can also lead to great communities. Key #1: Find the people you want to be like, find where they are, and hang out with them.
“Why flask? Why not Django?”
Recently I was asked this after introducing a new subsystem at work. Originally part of a monolithic Django app, this was new micro-service was one of the first pieces to be split out on its own. I had chosen Flask to be the web framework, and now it was time to explain why…
I’m not anti-Django, but…
Recently I decided to pull an old project out and use it as the basis of a new exciting thing I’m working on. More on that later! The old code was running on Google App Engine (GAE) and was written using the python web2app framework. Let’s take a look at the why and how of converting from web2app to flask.
GAE is pretty generous when it comes to letting developers run small apps on their service. That is a great way to get developer buy-in on your product. For years I’ve been running a couple of small projects for free on GAE and then talking about them in interviews.
The documentation for GAE used to use web2app as the Python sample code. Over the years they have evolved the service and documentation and today they tend to show Flask and Django when they are displaying sample code.
As a result of this, all of my GAE hosted projects have wound up being on web2app. And in the case of my current project, this is a problem.
Why switch to flask?
Tests are a contentious topic among programmers. Some really like them, others see them as a necessary evil. I think that they are important and if implemented correctly can improve both programmer productivity and code quality. Why? Flow.
Flow. It is the state of being so “in-the-zone” that things just happen. Actions are fluid. Progress is constant. Things are happening. This is where the awesome happens. So why doesn’t this happen more frequently?
I’ve always been curious about the world around me. And now thanks to reading a few great books I understand that I can easily do experiments on the world around me to learn where I can push the boundaries to learn new things!
Framing these things as experiments is a powerful mind hack: If an experiment fails, that’s ok! It was just an experiment. Keep that in mind the next time you find yourself pausing before trying something new or scary.
Let’s take a look at what I’ve been up to!
While doing some performance test on a new flask microservice, I noticed it was not handling very very many connections per second. Additionally, nginx (which we are using as our front end webserver) was reporting a ton of errors. WTF?!? I thought flask was fast. I need a faster flask!
Recently I have been describing myself as “A developer interested in entrepreneurship”. And lately I’ve been hearing a lot about masterminds. Inspired by a few podcasts, I threw together an MVP to see if I could find other like minded people who would be interested in a developer mastermind. Lets dive into this fun little experiment!