Flask trial run on PythonAnywhere

I felt it was about time I got into the web development side of Python, having learned enough of it to be dangerous. Since I moved my site to a PaaS, I wanted a quick and dirty alternative Python host that was easy to set up and use. Enter PythonAnywhere. This seemed to fit my immediate needs, as the site provides web-based bash, python and ipython shells for free users. They support both Python 2 and 3, so I went with the latter.

Next up, Flask. Their quickstart tutorial was what I used as a baseline. It seemed easier to start with than heavier alternatives like Django. Although the tutorial covers a minimal blog, I was able to make enough tweaks to it to get what I wanted.

Finally, a purpose. My wife is about a month away from delivering our first baby (oh let it be a girl, please 🙂 ), so I decided to make a simple site where the two of us could enter names that we wanted, for both genders. Each entry is equivalent to a blog post in the Flask tutorial, so the underlying code remained largely the same. It was easy enough to add the rest of the parts I needed. Here then is what it ended up looking like, and here’s a screenshot if I end up taking down the site later:

babynames

PythonAnywhere turned out to be a great experience. The founders were friendly enough to exchange a couple of mails directly, which was a fresh change from the noreply@website.com welcome mails that other sites favour. Getting the site up from my local test setup was a simple matter of ftp’ing a tar file over and extracting it.

Overall it took me less than half a day to get everything up, and another few hours of tweaking to add cute pictures and stuff.