在python中有一个captiveportal脚本,它可以与twisted一起使用,但它会在脚本中加载门户页面(搜索CAPTIVE_TEMPLATE)
https://github.com/bendemott/captiveportal/blob/master/captiveportal
如何加载一个完整的index.html文件夹,里面有js和css,还有其他像docs和files这样的文件?
诚挚的问候
发布于 2015-04-27 20:10:04
使用File并将其传递给一个目录。
from twisted.web.server import Site
from twisted.web.static import File
from twisted.internet import reactor
resource = File('/tmp')
factory = Site(resource)
reactor.listenTCP(8888, factory)
reactor.run()查看更多here
https://stackoverflow.com/questions/29895310
复制相似问题