python - Flask 在 Colab 上发送双重 GET 信号
问题描述
当我只按一次时,我的简单烧瓶程序正在发送双重 GET 请求?
我在这里看到了类似的帖子,上面说这可能是浏览器/扩展程序问题,但我检查了我的扩展程序,实际上只有谷歌扩展程序。
我该如何解决这个问题?我真的不能在谷歌本身上运行我的程序吗?
import os
from flask import send_from_directory, Flask, render_template_string
from flask_ngrok import run_with_ngrok
app = Flask(__name__)
run_with_ngrok(app)
@app.route("/")
def hello():
content='Hello!'
return render_template_string(f'''<!doctype html>
<html>
<head>
<link rel="icon" href="data:,">
</head>
<body>
<h1>{content}</h1>
</body>
</html>
''')
if __name__ == "__main__":
app.run()
* Serving Flask app "__main__" (lazy loading)
* Environment: production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
* Running on http://127.0.0.1:5000/ (Press CTRL+C to quit)
* Running on http://af8a7bff0c58.ngrok.io
* Traffic stats available on http://127.0.0.1:4040
127.0.0.1 - - [12/May/2021 07:59:22] "GET / HTTP/1.1" 200 -
127.0.0.1 - - [12/May/2021 07:59:23] "GET / HTTP/1.1" 200 -
解决方案
推荐阅读
- ios - 如何更新tableView单元格高度
- regex - 如何在 zgrep/zcat 命令中指定正则表达式?
- azure - POST 到 Bot 15 秒后超时
- r - Speeglm $ 运算符对原子向量无效
- node.js - 如何在角度 6 中修复未定义
- java - 如果我想使用 autoit 如何在 maven 项目中使用
- android - Cloud Vision - 您的应用包含公开的 Google Cloud Platform (GCP) API 密钥
- android - 在 AR-session Android 中使用 WebRTC 摄像头
- excel - If ElseIf 用于三个选项按钮
- c - 如何在 Visual Studio 2019 中只编译一个 C 文件?