diff --git a/__pycache__/flaskapp.cpython-38.pyc b/__pycache__/flaskapp.cpython-38.pyc new file mode 100644 index 0000000..af8f8e4 Binary files /dev/null and b/__pycache__/flaskapp.cpython-38.pyc differ diff --git a/__pycache__/flaskapp.cpython-39.pyc b/__pycache__/flaskapp.cpython-39.pyc new file mode 100644 index 0000000..af9ad2a Binary files /dev/null and b/__pycache__/flaskapp.cpython-39.pyc differ diff --git a/__pycache__/main.cpython-39.pyc b/__pycache__/main.cpython-39.pyc new file mode 100644 index 0000000..88ded3b Binary files /dev/null and b/__pycache__/main.cpython-39.pyc differ diff --git a/__pycache__/plots.cpython-39.pyc b/__pycache__/plots.cpython-39.pyc new file mode 100644 index 0000000..5bc2636 Binary files /dev/null and b/__pycache__/plots.cpython-39.pyc differ diff --git a/flaskapp.py b/flaskapp.py index 3116568..1f75b6e 100644 --- a/flaskapp.py +++ b/flaskapp.py @@ -1,21 +1,17 @@ +import io from flask import Flask, render_template app = Flask("Project Numeri") from plots import Cijferlijst import base64 cf = Cijferlijst() import matplotlib.pyplot as plt +from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas +from matplotlib.figure import Figure @app.route('/') def index(): - - data = cf.GetSubjectByYear("godsdienst", "2010/2011") - x = data['Datum invoer(Voortgangsdossier)'] - y = data['Cijfer(Voortgangsdossier)'] - plt.plot(x,y) - return render_template('index.html', title="joe", imgdata=None) + def RunWeb(): - app.run(debug=True) - - + app.run(debug=True, port=5002) diff --git a/main.py b/main.py index 4c94fb3..d302f3f 100644 --- a/main.py +++ b/main.py @@ -1,30 +1,58 @@ -from flaskapp import * -from plots import Cijferlijst +# based on https://gist.github.com/rduplain/1641344 + +import random +import io + +from flask import Flask, make_response, request +from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas +from matplotlib.figure import Figure + +app = Flask(__name__) -import matplotlib.pyplot as plt -from datetime import datetime -import matplotlib.dates as mdates +@app.route('/') +def root() : + return "