Exemple #1
0
 def __init__(self):
     self.mysql = MySQL()
     self.influx = InfluxDB()
     self.query = Query()
     cfg = getConfig()
     self.mysql.init_cfg(cfg)
     self.influx.init_cfg(cfg)
     self._con = self.mysql.get_connection()
     self.query.init_db(self._con, self.influx.get_client())
Exemple #2
0
 def __init__(self):
     self.mysql = MySQL()
     self.mongo = MongoDB()
     self.query = Query()
     cfg = getConfig()
     self.mysql.init_cfg(cfg)
     self.mongo.init_cfg(cfg)
     self._con = self.mysql.get_connection()
     self._client = self.mongo.get_client()
     self.query.init_db(self._con, self._client)
     self._db = self._client[cfg.MONGODB_COLLECTION]
Exemple #3
0
def getTemplate():
    cfg = getConfig()
    return cfg.Nofify_Template
Exemple #4
0
def getTable():
    cfg = getConfig()
    return cfg.INF_TABLE
Exemple #5
0
def getTimeZone():
    cfg = getConfig()
    return cfg.TIME_ZONE
from flask import Flask, render_template, redirect, url_for, send_from_directory
from route import private, page, public
from extensions import mysql, mongoDB, query, html_escape, getConfig

cfg = getConfig()

app = Flask(__name__)
app.config.from_object(cfg)

mysql.init_app(app.config)
mongoDB.init_app(app.config)
query.init_db(mysql.get_connection(), mongoDB.get_client())

app.register_blueprint(page.app)
app.register_blueprint(private.app, url_prefix="/api/private")
app.register_blueprint(public.app, url_prefix="/api/public")

@app.route("/")
def index():
	return redirect(url_for('Page.graph_view'))

@app.route("/favicon.ico")
def favicon():
	return send_from_directory("static","img/bulb.ico")

@app.errorhandler(404)
def page_not_found(e):
	return render_template('404.html'), 404

@app.errorhandler(403)
def page_forbidden(e):