This is an old revision of the document!
# apt install python3-venv $ python3 -m venv venv1 $ source venv1/bin/activate (venv1) $ which python (venv1) $ which ansible (venv1) $ deactivate
(venv1) :~$ pip install Flask (venv1) :~$ mkdir -p pywebd/; cd $_ (venv1) :~/pywebd$ cat app.py
from flask import Flask CONST_VER = "ver1.1" import socket hostname = socket.gethostname() app = Flask(__name__) @app.route('/') def home(): return '<h3>Hello world from pywebd on host ' + hostname + ' ' + CONST_VER + '</h3>' if __name__ == "__main__": app.run(debug=True, host='0.0.0.0', port=8080)
(venv1) :~/pywebd$ python app.py (venv1) :~/pywebd$ pip freeze > requirements.txt
dir$ python3 -m http.server 80