懒人记时 代码仓库
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.
 
 
 
 
 

23 lines
496 B

import sys
from flask import Flask
from markupsafe import escape # 字符串转义处理
from flask_sqlalchemy import SQLAlchemy
# SQLite windows适配
WIN = sys.platform.startswith('win')
if WIN:
prefix = 'sqlite:///'
else:
prefix = 'sqlite:////'
app = Flask(__name__)
db = SQLAlchemy(app) # 初始化拓展, 传入程序实例 app
@app.route('/')
def hello():
return 'Welcome to My Watchlist!'
@app.route('/user/<name>')
def user_page(name):
return f'User: {escape(name)}'