from flask import Flask, render_template, jsonify from routes.conditions import create_conditions_routes from db import get_connection, getRethinkDB from routes.create import create_routes from models.Abc import Abc from models.Condition import conditions app = Flask(__name__) r = getRethinkDB() create_routes(Abc, app) @app.route('/') def index(): cursor = r.table("conditions").run(get_connection()) conditions = list(cursor) return render_template('index.html', data={"conditions": conditions }) if __name__ == '__main__': app.run(host='0.0.0.0', port=8080, debug=True)