commit 1936f87b3654df5df7778e218001baa6585edaf2 Author: Ignace Date: Mon Mar 24 19:17:24 2025 +0000 first diff --git a/README.md b/README.md new file mode 100644 index 0000000..e69de29 diff --git a/meteoo.py b/meteoo.py new file mode 100644 index 0000000..c4ec56a --- /dev/null +++ b/meteoo.py @@ -0,0 +1,31 @@ +#!/usr/bin/python3 + +import sys +import os +import datetime +from rrdtool import update as rrd_update +from flask import Flask, request, session, g, redirect, url_for, abort, render_template, flash, json, make_response +from werkzeug.exceptions import HTTPException + +# configuration +DEBUG = False +SECRET_KEY = 'Mdevelopment key' + +app = Flask(__name__) +app.config.from_object(__name__) + +@app.route('/', methods=['GET']) +def index(): + ''' + pick up data for rrd's + ''' + if request.method == 'GET': + if 'binnen' in request.args: + ret = rrd_update(os.path.join('/var/www/suy.nl/w/fromhue.rrd'), request.args['binnen']) + return "Ok", 200 + + +if __name__ == '__main__': + app.secret_key = 'a38738svnlsfnviureiue598y3498f34ifjoielknf 3o4ifj o3i4f o3i4ufho3i4iwe34' + app.run(host='0.0.0.0', port=8080) + diff --git a/meteoo.wsgi b/meteoo.wsgi new file mode 100644 index 0000000..05e4165 --- /dev/null +++ b/meteoo.wsgi @@ -0,0 +1,15 @@ +#!/usr/bin/python3 + +import sys +sys.path.insert(0, '/usr/share/projects/wsgi_apps/meteoo') + +from meteoo import app as application + +# to add this Flas, python3 application to apache, you need to install the following +# sudo apt-get install python3-flask +# sudo apt-get install python3-pip +# sudo pip3 install twython +# +# sudo mkdir /var/dashboard2015 +# sudo chown www-data /var/dashboard2015 +# sudo apt-get install libapache2-mod-wsgi-py3