更改主机参数
app.run(debug=True,host='0.0.0.0',port=8000)
它定义服务器将侦听的IP地址,而不是DNS。有关更多说明,请参见link。
,
为foo.com
添加一个条目,指向您的开发PC主机文件中的本地IP(127.0.0.1)。例如,在Windows上,主机文件名为hosts
,对于标准安装,该文件位于C:\Windows\System32\drivers\etc
。
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally,comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
# 102.54.94.97 rhino.acme.com # source server
# 38.25.63.10 x.acme.com # x client host
127.0.0.1 foo.com
开发后,您将可以在foo.com:8000
上存储Flask页面。
本文链接:https://www.f2er.com/3136993.html