libvirt-front-py/index.py

15 lines
384 B
Python
Raw Normal View History

2021-03-25 22:53:50 +03:00
#!/usr/bin/python3
url_path = "http://192.168.100.50:5000"
from bottle import run, route, request, template,get ,post
import urllib.request, json
@route('/')
def index():
contents = json.loads(urllib.request.urlopen(url_path).read().decode())
return template('index', name=contents)
if __name__ == '__main__':
run(host='0.0.0.0', port=5000, debug=True, reloader=True)