Python web application using bottle mvc

Step1: Download python 2.7.x msi (stable version) from https://www.python.org/download/ and install it.

python windows download

Step2: After installed python, Install pip with bellow commands in command prompt for install the bottle framework.

Command:

python -c "exec('try: from urllib2 import urlopen \nexcept: from urllib.request import urlopen');f=urlopen('https://raw.github.com/pypa/pip/master/contrib/get-pip.py').read();exec(f)"
python pip command

Step3: Install bottle framework via below command:

pip install bottle

 

Step4: Write your hello-world script and put on your project dir.

from bottle import route, run

@route('/')
def hello():
    return 'Hello World';   
run(host='localhost', port=8080, debug=True)

You can also setup another framework with pip.

 

Step5: Write the bellow commands to view the result in web browser.
 

C:\> CD C:\<your-project-dir>
C:\Python27\my-project>python hello.py

 
Step6: Now you’re done you can see result through the url http://localhost:8080

 

Note: If any commands doesn’t work then please restart your machine after installing any package eg: python, pip.