关于web2py外网访问,图形界面不显示等问题的解决办法

作者: 2017加油 2017-02-01 10:01:07

首先系统版本是ubuntu 15.04,系统默认安装了两个版本的python。


sudo python web2py.py


默认会调用python2.7版本来执行。


 


会提示:


pydo@planpls:/var/python/web2py$ sudo python web2py.py


web2py Web Framework


Created by Massimo Di Pierro, Copyright 2007-2017


Version 2.11.2-stable+timestamp.


Database drivers available: sqlite3, imaplib, pymysql, pg8000


WARNING:web2py:GUI not available because Tk library is not installed


choose a password:


please visit:


http://127.0.0.1:8000/


use "kill -SIGTERM 6240" to shutdown the web2py server


提示 WARNING:web2py:GUI not available because Tk library is not installed


 


解决办法:


sudo apt-get install python-tk


然后就可以启动web2py的图形界面来,其中web2py启动参数可以配置不使用gui界面。


pydo@planpls:/var/python/web2py$ sudo python web2py.py


web2py Web Framework


Created by Massimo Di Pierro, Copyright 2007-2017


Version 2.11.2-stable+timestamp.


Database drivers available: sqlite3, imaplib, pymysql, pg8000


please visit:


http://127.0.1.1:8000/


starting browser...




 


大家可以看到右侧打图形界面,以前一直不能解决web2py写打程序从外部不能访问打问题,wamp可以切换服务器是否在线,现在看了图形界面才知道可以设置Server IP是否公开的啊,看来gui界面也有直观易懂的好处啊,启动参数怎么写不知道,不过gui形式启动,参数设置不生效果。


x选择:Public(0.0.0.0)外网可以访问,这种机制很棒。


 


至此,困扰三四周的解决,虽然笨了点,可还是解决了呀。


>>> python web2py.py -h


Usage: python web2py.py


web2py Web Framework startup script. ATTENTION: unless a password


is specified (-a 'passwd'), web2py will attempt to run a GUI.


In this case command line options are ignored.


 


本文永久更新地址:http://www.linuxdiyf.com/linux/28085.html

相关资讯