Jeff Sloyer previously wrote a tutorial on creating a basic Flask app on the Pi. He has now expanded on this and written a new tutorial in which he creates an Internet of Things app using Python and an IBM system known as Bluemix. He’s uploaded all the code necessary to build the IoT app for you to download. Take a look here.