You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
1.1 KiB

# -*- encoding: utf-8 -*-
'''
@File : app.py
@License : (C)Copyright 2018-2022
@Modify Time @Author @Version @Desciption
------------ ------- -------- -----------
2023/4/13 14:26 zart20 1.0 None
'''
from flask import Flask, render_template
from models import User, City_Info
from database import *
app = Flask(__name__)
@app.route("/")
def hello():
return "<h1>hello</h1>"
@app.route('/hello/')
@app.route('/hello/<name>/')
def hello_2(name=None):
return render_template('index1.html', name=name)
@app.route("/99/")
def multi():
table = []
for i in range(1, 10):
row = []
for j in range(1, i + 1):
row.append('{}x{}={}'.format(j, i, i * j))
table.append(row)
return render_template('table.html', table=table)
@app.route("/city_info/")
def city_info():
filter = ["province", "cityname", 'usernumber', '操作']
info = City_Info.query.all()
dic = {"filter":filter, "info":info}
return render_template('city_info.html', dic=dic)
if __name__ == '__main__':
init_db() # 初始化数据库
app.run(host="0.0.0.0", port=8080, debug=True)