If you are just starting with webdevelopment, have a look at Bottle. Bottle is simpler than flask in the sense that it is a complete web-framework within a single file. In contrast, Flask aims to reuse sound code from different libraries and might therefore be more solid, but also more complex.
Here is the Hello World with Bottle:
from bottle import route, run, template
@route('/hello/:name')
def index(name='World'):
return template('<b>Hello {{name}}</b>!', name=name)
run(host='localhost', port=8080)
Run it with:
python HelloBottle.py
And open in a browser: http://localhost:8080/hello/world
To make your website available from other computers, set host
to 0.0.0.0
in the run
method. The last line of the above Hello World should then read:
run(host='0.0.0.0', port=8080)
You should now be able to access your website via the Pi's IP address, like this: http://192.168.0.123:8080/hello/world
See the bottle documentation on deployment for further details.