我怎样才能提供扭曲的外部文件夹?

时间:2015-04-27 12:06:50

标签: python twisted

python中有一个captiveportal脚本可以使用twisted,但它会在脚本中加载门户页面(搜索CAPTIVE_TEMPLATE)

https://github.com/bendemott/captiveportal/blob/master/captiveportal

如何加载带有js和css的完整index.html文件夹以及其他材料,例如带有扭曲的文档和文件?

最好的问候

1 个答案:

答案 0 :(得分:3)

使用文件并将其传递给目录。

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

相关问题