我的HTML页面有以下几行:
<h5 id="user_name" name="user_name" value="{{ username }}">{{ username }}</h5>
<button id="btn" name="visualize">Visualize</button>
我的烧瓶应用程序中有一个函数,该函数应读取该值并执行如下检查:
user = request.args.get('user_name')
username = str(user)
hname = []
allh = []
mydict = {}
for row in result:
if row[1] == username:
allh.append(row[2])
if row[2] not in hname:
hname.append(row[2])
counter = collections.Counter(allh)
我尝试了所有方法从请求中获取值-.form,.values,.args。没事。有解决方案吗?