gowilango / webserver.py

Python Web Server (using Flask)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python Web Server using Flask

for macOS

Make Sure you have NPM installed.

$ sudo easy_install pip

Install Flask

$ pip install flask

Install virtualenv (Virtual Environment Python)

$ sudo pip install virtualenv

then, Install Nose and Tornado

$ sudo pip install nose
$ sudo pip install tornado

Type

$ pip list

to make sure flask, virtualenv, nose, tornado is installed

Web Server Structure

main directory
|
|-- launch 
|
|-- server
    |
    |-- index.py
    |
    |-- static
    |
    |-- templates

Create a virtualenv

$ virtualenv anyname
$ pip install flask

To Activate the virtualenv

$ cd launch
$ source bin/activate

To start the Python Web Server

$ cd server
$ python index.py runserver

About

Python Web Server (using Flask)


Languages

Language:Python 99.3%Language:CSS 0.2%Language:JavaScript 0.2%Language:C 0.2%Language:Shell 0.1%Language:HTML 0.0%