Wednesday, November 22, 2017

Bottle getting started

Looking for an alternative to Django...

Apparently webpy is basically dead. Bottle seems to be alive, and ported to Python 3

sudo pip3.6 install bottle


paste this code:

from bottle import route, run, template

def index(name):
    return template('Hello {{name}}!', name=name)

run(host='localhost', port=8080)

Enter in the browser:

It can't be simpler! Compare it to the same code in Java...

No comments: