first
This commit is contained in:
@@ -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)
|
||||||
|
|
||||||
+15
@@ -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
|
||||||
Reference in New Issue
Block a user