Quote:but for starters on the server end do I need to setup the server as an HTML server?
You can test all out locally
Flask as posted over has a build in web-server.
Here a demo.
#app.py
from flask import Flask, render_template
from bs4 import BeautifulSoup
app = Flask(__name__)
@app.route('/')
def index():
return render_template('index.html')
@app.route('/xml-value/')
def my_link():
xml = '''\
<?xml version="1.0" encoding="UTF-8"?>
<note>
<value>4.567</value>
</note>'''
soup = BeautifulSoup(xml, 'lxml')
val = soup.find('value').text
return val
if __name__ == '__main__':
app.run(debug=True)
# In templates folder
#index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Title of the document</title>
</head>
<body>
<form>
<button formaction="/xml-value/">Get value</button>
</form>
</body>
</html>
python app.py
in browser
http://127.0.0.1:5000/
.
So getting a value from XML when push a button(call a Python function on the server side).
If you all new to this and web-development stuff with Python there is a learning process.
When it comes deploy,here some stuff that i like.
Gunicorn with
Nginx(better than and easier than Apache) on host
Digital Ocean.
There are host like
PythonAnywhere and AWS Lambda
Zappa,
they do all server side setup for you.