WARNING: This is a development server. Do not use it in a production deployment. falsk WSGI

   Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.

记录一下这个问题,

   Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.


其实就是flask未使用 WSGI 启动,所以使用wsgi启动就行了,我找到两种方式,但不知道怎么比较好坏,但以我的理解,底层都是wsgi,只是封装库不同而已。。。

希望大神指点一下

方法一:

from gevent import pywsgi

if __name__ == '__main__':
    server = pywsgi.WSGIServer(('0.0.0.0', 5000), app)
    server.serve_forever()

方法二:

from wsgiref.simple_server import make_server

if __name__ == '__main__':
    server = make_server('', 64570, app)
    server.serve_forever()

 

  • 30
    点赞
  • 109
    收藏
    觉得还不错? 一键收藏
  • 40
    评论
英文原版,数字版,有目录。 Express in Action: Writing, building, and testing Node.js applications 1st Edition Summary Express in Action is a carefully designed tutorial that teaches you how to build web applications using Node and Express. Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications. About the Technology Express.js is a web application framework for Node.js. Express organizes your server-side JavaScript into testable, maintainable modules. It provides a powerful set of features to efficiently manage routes, requests, and views along with beautiful boilerplate for your web applications. Express helps you concentrate on what your application does instead of managing time-consuming technical details. About the Book Express in Action teaches you how to build web applications using Node and Express. It starts by introducing Node's powerful traits and shows you how they map to the features of Express. You'll explore key development techniques, meet the rich ecosystem of companion tools and libraries, and get a glimpse into its inner workings. By the end of the book, you'll be able to use Express to build a Node app and know how to test it, hook it up to a database, and automate the dev process. What's Inside Simplify Node app setup with Express Testing Express applications Use Express for easy access to Node features Data storage with MongoDB Covers Express 4 and Express 5 alpha About the Reader To get the most out of this book, you'll need to know the basics of web application design and be proficient with JavaScript. About the Author Evan Hahn is an active member of the Node and Express community and contributes to many open source JavaScript projects. Table of Contents PART 1 INTRO What is Express? The basics of Node.js Foundations of Express PART 2 CORE Middleware Routing Building APIs Views and templates: Pug and EJS PART 3 EXPRESS IN CONTEXT Persisting your data with MongoDB Testing Express applications Security Deployment: assets and Heroku Best practices

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 40
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值