Getting started with Flask

Let us get started with installing the Flask micro web framework. It is quite simple, using pip. I always recommend to use virtualenv or virtualenvwrapper for all the python based projects, even on Docker or Vagrant.

To install virtualenv,

[sudo] pip install virtualenv

and to install virtualenvwrapper,

pip install virtualenvwrapper

I personally prefer virtualenvwrapper, but it is extended fucntionality of virtualenv itself. I will continue with virtualenvwrapper tool for the rest of my tutorial.

Now, we need to create a virtualenvwrapper project, so I will run the command,

$ mkvirtualenv myapp

then your console should look something like,

(myapp)naveen@mycomputer:~/yourprojectfolder/$

For simplicity, lets just use (myapp)$

Now, to install the Flask,

(myapp)$ pip install Flask

If you want to have a system wide install, then you have to do,

(myapp)$ sudo pip install Flask

That is it! You are set to go with Flask!