How to install Flask

How to install Flask

wget http://pypi.python.org/packages/source/F/Flask/Flask-0.10.tar.gz
tar -xzf Flask-*.tar.gz
cd Flask-*

Installing..

python2.6 setup.py install --user

Update your .htaccess with the following lines:

vi .htaccess

AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.fcgi/$1 [QSA,L]

Update your index.fcgi with the following lines:

vi index.fcgi

#!/usr/bin/env python2.6
from flask import Flask
from flup.server.fcgi import WSGIServer
app = Flask(__name__)
 
@app.route('/')
def hello():
    return "Hello world!"
 
WSGIServer(app).run()

Set an executable permissions

chmod +x index.fcgi

Probably you will need to manually install FLUP

mkdir temp
cd temp
wget https://pypi.python.org/packages/10/28/7f3a17c792fa224ef8624f504db44fcf803bd066466f808fcb6b7a8e65f4/flup-1.0.2.tar.gz
tar -xvf flup-1.0.2.tar.gz
cd flup-1/
python2.6 setup.py install --user

Similar Posts:

Leave a Reply

Your email address will not be published.