python-----flask项目端口设置无效

最近在做flask项目时发现了一个问题,在项目里写:

    app.run(host='0.0.0.0',port=9000)

但启动时,还是使用5000端口启动的。

后来经过测试,解决方法有两个:

如果启动时是  FLASK_ENV = development

 

方法一:调成 Environment: production,具体方法:

1.点击框1,然后选择 Edit Configurations...:

python-----flask项目端口设置无效

2.点击 ‘+’ ,在弹出的框中选择 python ,在 Name 旁写启动项目名称,在 Script path 写要启动的脚本路径。

python-----flask项目端口设置无效

最后点击Apply ,然后点击OK就可以了

 

方法二:重复方法一的第一步,然后在 Additional options:里如下图填写即可。

python-----flask项目端口设置无效

最后点击 Apply ,然后点击OK就可以了

 

posted @ 2019-03-02 13:25 小呆丶 阅读(...) 评论(...) 编辑 收藏

相关文章:

  • 2021-11-23
  • 2022-02-23
  • 2022-12-23
  • 2021-07-23
  • 2021-04-01
  • 2022-12-23
  • 2022-01-08
  • 2021-05-31
猜你喜欢
  • 2021-07-09
  • 2021-09-19
  • 2021-09-04
  • 2022-12-23
  • 2021-10-10
相关资源
相似解决方案