Flask - WSGI micro framework based on WerkZueg and Jinga2

Flask  a WSGI (Web Server Gateway Inteface) for python based on WerkZueg and Jinga2.  WerkZueg is a toolkit for WSGI, the standard Python interface between web application and a variety of servers for both development and deployment.  Jinja2 renders templates.

How to Install flask:

There are many ways one could install flask but virtualenv is one interesting way to do this. 

virtualenv:

Virtualenv is the best way to deal with multiple version of python and it's modules during the development and production too. Virtaulenv help's solve the problem of separating out multiple versions of python and its modules and give us the flexibility of switching between multiple version of python in a sane way. Helping us maintaining multiple version doesn't mean that Its going to install separate copies of python but it does provides a smart way to keep different project environments isolated. 

How to Install virtualenv: 

mac:

$ sudo easy_install virtualenv
or
$ sudo pip install virtualenv

ubuntu: 

$ sudo apt-get install python-virtaulenv

Now that the virtualenv is installed let's create our own environment. 
Best way to do that, is to create a venv sub-folder inside the project folder.

$ mkdir project-1
$ cd project-1
$ virtualenv venv-1

Virtaulenv venv-1 should be ready for us to install flask after we activate it.

$ venv-1/bin/activate

Now that, virtualenv venv-1 is active (your prompt would have changed to notify that you are inside the venv-1)  let's install flask.

$ sudo pip install flask  (this would install flask inside the virtualenv venv-1)

Comments

Popular posts from this blog

How to find the source branch of a branch in git

yarn nodemanager doesn't start - Caused by: EPERM: Operation not permitted

gpg: cancelled by user