Source

POS Front End Updated UI / FlaskServer.py

#!/usr/bin/python -tt
from flask import Flask, url_for, request, redirect, jsonify, Response, render_template

app = Flask(__name__)

@app.route('/')
def index():
    print 'in index'
    return render_template('index.html')


@app.route('/purchase')
def purchase():
    return render_template('purchase.html')

@app.route('/products', methods=['GET', 'POST'])
def products():
    from urllib import urlopen
    f = urlopen('http://lowe.jschua.com/DinoPos/api/products/')
    data = f.read()
    resp = Response(data, status=200, mimetype='application/json')
    return resp

def determine_strategies(request):
    return input_strat, kwic_strat

if __name__ == '__main__':
    app.run(host='0.0.0.0', debug=True)