Exemplo n.º 1
0
from DataWarehouse.database.class_database import Database
from flask import Flask, render_template, request, redirect, url_for, jsonify
from DataWarehouse.data.class_regiondata import RegionData
import json
from bokeh.plotting import figure
from bokeh.embed import components
from werkzeug.utils import secure_filename
import flask.ext.login as flask_login

app = Flask(__name__)
app.secret_key = 'super secret string'  # Change this!

# 创建初始数据
# 导入CEIC数据
db = Database()
con = db.connect('regionDB', 'CEIC')
period = range(1990,2015)
# 创建区域数据
region_list = json.load(open('e:/gitwork/application/testweb/region_ceic.txt'))
variables = con.find().distinct('variable')
rdata = RegionData()
# Our mock database.
users = {'*****@*****.**': {'pw': '123456'}}

# prepare some data
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
# create a new plot with a title and axis labels
p = figure(title="simple line example", x_axis_label='x', y_axis_label='y')
# add a line renderer with legend and line thickness
p.line(x, y, legend="Temp.", line_width=2)