Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
711 views
in Technique[技术] by (71.8m points)

python - 服务器在终端中运行,但未显示在页面中。 服务Flask应用“应用”(延迟加载)(Server runs in terminal but doesn't appear in the page. Serving Flask app “application” (lazy loading))

  • Serving Flask app "application" (lazy loading)

    (服务Flask应用“应用”(延迟加载))

  • Environment: production WARNING: Do not use the development server in a production environment.

    (环境:生产中警告:请勿在生产环境中使用开发服务器。)

    Use a production WSGI server instead.

    (请改用生产WSGI服务器。)

  • Debug mode: off

    (调试模式:关闭)

    @application.route('/', methods=['POST', 'GET']) @application.route('/') def default():

    (@ application.route('/',methods = ['POST','GET'])@ application.route('/')def default():)

Originally, running python application.py works - the page appears but after a while of doing the same thing, the web page doesn't appear anymore and instead the warning above shows in my terminal.

(最初,运行python application.py可以正常工作-该页面出现,但经过一阵子相同的操作后,该网页不再显示,而是在我的终端中显示了以上警告。)

What is the problem?

(问题是什么?)

  ask by Chelsea Ip Tze Hwan translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

https://flask.palletsprojects.com/en/0.12.x/deploying/

(https://flask.palletsprojects.com/zh-CN/0.12.x/??deploying/)

" While lightweight and easy to use, Flask's built-in server is not suitable for production as it doesn't scale well and by default serves only one request at a time. "

(“虽然轻巧易用,但Flask的内置服务器不能很好地进行生产,因为它不能很好地扩展,并且默认情况下一次只能满足一个请求。”)

I also found this: warning message while running flask

(我也发现了这一点: 运行烧瓶时出现警告消息)

If you search with the warning/error message you get, you will find questions that were already answered.

(如果搜索得到的警告/错误消息,您将发现已经回答的问题。)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...