我在 Flask Python Web 上显示我的 IP 地址时遇到问题。打个比方,如果在PHP编程中很容易就用
echo $_SERVER['SERVER_ADDR'];
但我不知道如何在 Python Flask Web 中调出 IP 地址。
在 192.168.43.46:4000 上运行的应用程序,而我想显示:
<iframe id="form-iframe" src="http://192.168.43.46/vshell/index.php?type=services&clearcache=true" style="margin:0; width:100%; height:640px; border:none; overflow:hidden;" onload="AdjustIframeHeightOnLoad()"></iframe>
Run Code Online (Sandbox Code Playgroud)
烧瓶中使用的脚本
<iframe id="form-iframe" src="{{ request.script_root }}/vshell/index.php?type=services&clearcache=true" style="margin:0; width:100%; height:640px; border:none; overflow:hidden;" onload="AdjustIframeHeightOnLoad()"></iframe>
Run Code Online (Sandbox Code Playgroud)
并出现在客户端浏览器上:
如何显示:
src="http://192.168.43.46/vshell/index.php?type=services&clearcache=true"
Run Code Online (Sandbox Code Playgroud)
在烧瓶上?