关于报错:This is a development server. Do not use it in a production deployment.Use a production
WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead
原写法
if __name__ =='__main__':app.run(host='0.0.0.0',port=5000)
后来觉得这句Use a production WSGI server instead是关键。所以有以下两种解决方法,首推法1.
关于python中WSGI服务器的两种实现
1.用gevent包里的pywsgi
优点:速度快,第三方开发维护
if __name__ == '__main__':from gevent import pywsgiserver = pywsgi.WSGIServer(('0.0.0.0',5000),app)server.serve_forever()
2、用python内置的WSGI服务器
速度反应慢,而且在我的实验环境下能启动运行,但是发送GET和POST请求是返回404和500。无法使用。
if __name__ =='__main__':from wsgiref.simple_server import make_serverserver = make_server('127.0.0.1',5000,app)server.serve_forever()app.run()
关于报错:This is a development server. Do not use it in a production deployment.Use a production相关推荐
- 启动项目报错:null, message from server: “Host ‘XXX‘ is not allow
step1:之前一直都是连的测试环境由docker镜像生成的mysql,公司老是断电导致mysql数据崩坏,于是在本地整了个8.0.18版本的mysql,启动项目报错:null, message fr ...
- 使用Umi SSR 报错 Warning: Did not expect server HTML to contain a <div> in <div>.
问题描述: 使用umi进行服务端渲染报错 Warning: Did not expect server HTML to contain a <div> in <div>. 解 ...
- Arcgis Server 发布服务报错Failed to start the server machine ‘XXX‘. Error while starting AppServer. Requir
Arcgis Server 发布服务报错 Failed to start the server machine 'XXX'. Error while starting AppServer. Requi ...
- 解决idea运行Tomcat报错:Unable to ping server at localhost:1099
方法一: 网上有人说修改hosts,目录定位到"C\windows\system32\drivers\etc\hosts,在里面添加: 127.0.0.1 localhost 计算机名 这个 ...
- 客户端启动报错java.lang.IllegalArgumentException: no server available的解决方案 SpringCloud中 Nacos做注册中心
客户端启动报错java.lang.IllegalArgumentException: no server available的解决方案 SpringCloud中 Nacos做注册中心(谷粒) 报错内容 ...
- 已解决WARNING: This is a development server. Do not use it in a production deployment. Use a production
已解决(flask服务器启动报错)WARNING: This is a development server. Do not use it in a production deployment. Us ...
- pymssql连接sql server报错Unable to connect: Adaptive Server is unavailable
1.报错现象 b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable ...
- 按照黑马教程学习javaWeb出现Property ‘dataSource‘ is requir报错HTTP Status 500 – Internal Server Error——解决方案
在做网页登录时候,servlet无法连接到数据库,报错提示 Property 'dataSource' is required 具体错误如下: HTTP Status 500 – Internal S ...
- 解决Springboot2.X,无法用HttpSession报错org.apache.tomcat.websocket.server.WsSessionListener.sessionCreated
一.今天在学习 springboot2.x 拦截器的时候,发现直接使用 HttpSession 和 request.getSession().getAttribute() 会直接报错: 我的sprin ...
最新文章
- Weka 开发[1]-Instances类
- org.apache.commons.lang.StringUtils
- 十四周三次课、MySQL主从配置
- 您的Apache Camel应用程序现在包括现成的文档
- 从java读取Excel继续说大道至简 .
- 京东商品及评论爬虫(selenium)
- 浅析常用软件架构中的一定要理解的三种架构模型
- selenium的基本使用
- 鸿蒙系统 闹钟,华为鸿蒙2.0操作系统正式版
- java程序中默认包含的是_在编写 Java 程序时,如果不为类的成员变量定义初始值, Java 会给出它们的默认值,下列说法中不正确的一个是( )。...
- 嵌入式环境搭建之NFS
- 机器视觉LCD行业质量检测解决方案
- 几种在Linux下查询外网IP的办法(转)
- Scrapy(一)爬知乎所有用户信息
- 我的世界乘法计算机,《我的世界》计算器的加法和乘法器电路图文教程
- 使用Arduino驱动 ADS1115 ADC采样芯片
- android tee os,有关OP-TEE - 中文社区论区 - 中文社区 - Arm Community
- 如何让Bing快速收录你的网站?
- mysql容灾方案_mysql 容灾 灾备 备份
- 【光学】发散角的奥秘