You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
692 B
28 lines
692 B
6 years ago
|
import json
|
||
|
import requests
|
||
|
from flask import Flask
|
||
|
from flask import render_template, request, Response
|
||
|
import xmlrpc.client
|
||
|
|
||
|
s = xmlrpc.client.ServerProxy('http://localhost:8000')
|
||
|
app = Flask(__name__)
|
||
|
|
||
|
|
||
|
@app.route('/', strict_slashes=False)
|
||
|
def index():
|
||
|
return render_template('index.html')
|
||
|
|
||
|
@app.route('/order', methods=['POST'])
|
||
|
def order():
|
||
|
candy1 = int(request.form['candy1'])
|
||
|
candy2 = int(request.form['candy2'])
|
||
|
candy3 = int(request.form['candy3'])
|
||
|
candy4 = int(request.form['candy4'])
|
||
|
print ("test {} {} {} {} ".format(candy1, candy2, candy3, candy4))
|
||
|
return '{"status":"ok"}'
|
||
|
#s.new_order(params)
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
app.run('0.0.0.0')
|