The following is a guest post by Cam Linke, co-founder of Startup Edmonton.
Welcome! Today we're going to build an app using Flask with a simple text box that you enter text into and the app processes and displays a count of how many times each word appears on the page.
- In part one, we'll set up a local development environment and then deploy both a staging environment and a production environment on Heroku.
- In part two, we'll be doing a bunch of backend processing to count the words of a web page so we’ll implement a request queue that will do the actual processing of the words.
We'll start with a basic "Hello World" app on Heroku with staging (or pre-production) and production environments.
To get our initial setup created we're going to use Virtualenv and Virtualenvwrapper. This will give us a few extra tools to help us silo our environment. I'm going to assume for this tutorial you've used the following tools before:
- Virtualenv - http://www.virtualenv.org/en/latest/
- Virtualenvwrapper - http://virtualenvwrapper.readthedocs.org/en/latest/
- Flask - http://flask.pocoo.org/
- git/Github - http://try.github.io/levels/1/challenges/1
- Heroku (basics) - https://devcenter.heroku.com/articles/getting-started-with-python
First things first, let's get a repo set up. Create a repo in Github (if you want) and clone it into your working directory. Alternatively, initialize a new git repo within your working directory: