【问题标题】:Flask-cookiecutter how to change the default ip and port in devFlask-cookiecutter 如何更改dev中的默认ip和端口
【发布时间】:2017-07-14 04:12:36
【问题描述】:

我正在尝试使用flask-cookiecutter https://github.com/konstantint/cookiecutter-flask 来构建网站/学习flask 和webdev。我在 mac 上设置了 dev env,我想从我的 mac 上的 Centos VM 运行它。我的问题是如何以不可怕的方式将默认 ip 和端口设置为 http://127.0.0.1:5000/ 以外的其他内容(修补烧瓶源代码)?

【问题讨论】:

  • 你想在另一个端口运行flask吗?
  • 我希望它在不同的 IP 和端口上运行
  • 试过这个flask run -h 127.4.5.4 -p 5242
  • Flask Cookiecutter 说使用“npm start”,我想让它与“npm start”一起使用
  • 在文档中关于npm start 的位置是什么?

标签: python flask web-development-server cookiecutter


【解决方案1】:

要更改烧瓶运行默认值,请编辑 package.json 节点文件

--h 192.168.33.15 添加到 'npm run flask-server' 字符串中

文档:https://docs.npmjs.com/cli/run-script

【讨论】:

    猜你喜欢
    • 2012-05-28
    • 1970-01-01
    • 1970-01-01
    • 2015-05-24
    • 2016-11-02
    • 2011-10-19
    • 1970-01-01
    • 2019-09-08
    • 2019-12-25
    相关资源
    最近更新 更多