mirror of
https://gitee.com/insArvin/nypc_python_advanced.git
synced 2026-04-18 00:02:28 +08:00
add Web/DoubanMovieWeb/app.py.
Signed-off-by: iamzhaohaibo <941604465@qq.com>
This commit is contained in:
18
Web/DoubanMovieWeb/app.py
Normal file
18
Web/DoubanMovieWeb/app.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from flask import Flask, render_template
|
||||
from DB import DB
|
||||
|
||||
db = DB()
|
||||
conn = db.connect()
|
||||
douban_table = db.table()
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@app.route('/', methods=['GET'])
|
||||
def index():
|
||||
result = conn.execute(douban_table.select())
|
||||
return render_template('index.html', rows=result)
|
||||
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
app.run()
|
||||
Reference in New Issue
Block a user