libvirt-front-py/index.py

15 lines
394 B
Python
Raw Permalink 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():
2021-03-26 01:44:03 +03:00
domainList = json.loads(urllib.request.urlopen(url_path).read().decode())
return template('index', domainList=domainList)
2021-03-25 22:53:50 +03:00
if __name__ == '__main__':
run(host='0.0.0.0', port=5000, debug=True, reloader=True)