Phil Dreizen

Python Flask

I decided to learn flask for the purpose of implementing a RESTful API in Python. The two major choices seem to be Django and Flask. Flask is a lightweight option, which was more appealing to me for the flexibility that comes with that.

After doing the tutorial I do like it enough to try it out.

One thing I'm not liking from the tutorial is how a single function has to handle multiple methods (ie GET and POST), explicitly checking the request for which method is being used. It's hardly a deal-breaker.

I did briefly look at Flask-RESTful which addresses this by having each url map to a "resource" class which has methods that correspond to each HTTP method. So the class' "post()" method is mapped to a POST request. I think I prefer that, so I'll be looking at Flask-RESTful and its various forks (Flask-RESTplus, Flask-RESTx....and so on).

FYI: I'm currently most familiar with Java's Jersey framework for REST APIs.

BTW: Though Flask-RESTful's "resource" class is named the same as Jersey's "Resource" concept, I actually think vanilla Flask's Blueprint is closer.

tags: TIL, flask, python
Intro to "Today I Learned" (TIL) Posts

This post is an announcement: I'm taking some time to work on some personal projects and learn some new things, and I plan on sharing some of that here. I'll be working on bothlarger projects and smaller "projectlets." Stay tuned

Server Upgrade Fail

A recent upgrade did not go as smoothly as I had hoped, and this site has been garbled for a good week. The fix was easy. FWIW, I'm considering switching to an off the shelf static site generator.

wallabag

wallabag is an application for saving websites to read later - a 'read-it-later' service. The most famous one, right now, is Pocket. Wallabag is a free software alternative. You can self-host it or you can create a paid account at wallabag.it.

My cursory impressions - I've only been using it for a few days - is that it's quite good. I find the interface very simple, the Firefox plugin is easy to use, and I like how the saved articles look. I might (risk) trying the kobo application soon.

qotd

"America is finding out the hard way that much of its government is based on tradition and the honor system, and not explicit laws. There will be a crisis every day." --Garry Kasporov

http://www.vox.com/conversations/2017/2/11/14577834/garry-kasparov-putin-trump