一个轻量级框架来托管生成的HTML文件

时间:2015-05-08 22:25:51

标签: python html django

我有大约100个(这可能增加10倍)从python脚本的输出生成的HTML页面。 每个页面有20行,带有一些文本字段。

假设这些必须由人进行QA' - 因此我需要找到一个轻量级方法来打包所有这些HTML页面[总共100个],以便测试它的人可以分配反馈[很高兴有底部的表格,但没有必要]

**是否有轻量级框架,我可以用来托管所有这些单独的HTML? **或者,指向相关示例会有所帮助。

如果它是一个现成的工具,那么它可以工作,否则,最好与Python融合。

以下是快速&我的用例的脏版本。 enter image description here

<!DOCTYPE html>
<html>
<body>
<img src="https://subscription-assets.timeinc.com/current/9521_top1_100_thumb.jpg" alt="Smiley face" width="40" height="40" ALT="picture of a pumpkin" ALIGN=LEFT>  product #1
<img src="http://o.aolcdn.com/hss/storage/midas/2cad0c9f8938293b178d35418367c5c0/201969261/Edit_01Watson%2BGrilled%2BLobster%2B-%2B37jt.jpg" alt="Smiley face" width="40" height="40" ALT="picture of a pumpkin" ALIGN=RIGHT>  
</body>
</html>

编辑 - :在部署cactus时,我看到以下错误消息。 基本问题:所以我需要确保域名不存在,对吗?

Bucket does not exist. Create it? [y/n] > y
Bucket MASKED1/MASKED2/www.experimentlabs.com/ was created with website endpoint MASKED1/MASKED2/www.experimentlabs.com/.s3-website-us-east-1.amazonaws.com
Bucket Name: MASKED1/MASKED2/www.experimentlabs.com/
Bucket Web Endpoint: MASKED1/MASKED/www.experimentlabs.com/.s3-website-us-east-1.amazonaws.com
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 8.0 seconds...
[Errno -2] Name or service not known, Retrying in 8.0 seconds...
[Errno -2] Name or service not known, Retrying in 8.0 seconds...
[Errno -2] Name or service not known, Retrying in 8.0 seconds...
+ static/js/vendor/bootstrap.js - 57kb (11kb compressed)
+ sitemap.xml - 484b (199b compressed)
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
+ static/js/vendor/jquery-1.10.1.js - 268kb (79kb compressed)
[Errno -2] Name or service not known, Retrying in 1.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 2.0 seconds...
[Errno -2] Name or service not known, Retrying in 8.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
[Errno -2] Name or service not known, Retrying in 4.0 seconds...
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/parallel.py", line 18, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/engine.py", line 41, in <lambda>
    totalFiles = mapper(lambda p: p.upload(), self.files())
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/file.py", line 125, in upload
    remote_changed = self.remote_changed()
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/network.py", line 29, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/s3/file.py", line 35, in remote_changed
    remote_headers = dict((k, v.strip('"')) for k, v in getURLHeaders(self.remote_url()).items())
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/url.py", line 16, in getURLHeaders
    conn.request('HEAD', urllib.quote(url.path))
  File "/usr/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 812, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 793, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known

Traceback (most recent call last):
  File "/usr/local/bin/cactus", line 9, in <module>
    load_entry_point('Cactus==3.0.2', 'console_scripts', 'cactus')()
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/cli.py", line 114, in main
    args.target(**{k: v for k, v in vars(args).items() if k != 'target'})
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/cli.py", line 42, in deploy
    site.upload()
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/site.py", line 479, in upload
    totalFiles = self.deployment_engine.deploy()
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/engine.py", line 41, in deploy
    totalFiles = mapper(lambda p: p.upload(), self.files())
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/parallel.py", line 25, in multiMap
    return pool.map(wrapper, items)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 251, in map
    return self.map_async(func, iterable, chunksize).get()
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 558, in get
    raise self._value
AssertionError
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/parallel.py", line 18, in wrapper
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/engine.py", line 41, in <lambda>
    totalFiles = mapper(lambda p: p.upload(), self.files())
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/file.py", line 125, in upload
    remote_changed = self.remote_changed()
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/network.py", line 29, in f_retry
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/deployment/s3/file.py", line 35, in remote_changed
    remote_headers = dict((k, v.strip('"')) for k, v in getURLHeaders(self.remote_url()).items())
  File "/usr/local/lib/python2.7/dist-packages/Cactus-3.0.2-py2.7.egg/cactus/utils/url.py", line 16, in getURLHeaders
    conn.request('HEAD', urllib.quote(url.path))
  File "/usr/lib/python2.7/httplib.py", line 1001, in request
    self._send_request(method, url, body, headers)
  File "/usr/lib/python2.7/httplib.py", line 1035, in _send_request
    self.endheaders(body)
  File "/usr/lib/python2.7/httplib.py", line 997, in endheaders
    self._send_output(message_body)
  File "/usr/lib/python2.7/httplib.py", line 850, in _send_output
    self.send(msg)
  File "/usr/lib/python2.7/httplib.py", line 812, in send
    self.connect()
  File "/usr/lib/python2.7/httplib.py", line 793, in connect
    self.timeout, self.source_address)
  File "/usr/lib/python2.7/socket.py", line 553, in create_connection
    for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known


s3cmd ls -r s3://MASKED1/MASKED2/www.experimentlabs.com/
2015-05-11 18:19       105   s3://MASKED1/MASKED2/www.experimentlabs.com/
2015-05-11 18:20       199   s3://MASKED1/MASKED2/www.experimentlabs.com/sitemap.xml
2015-05-11 18:20     10796   s3://MASKED1/MASKED2/www.experimentlabs.com/static/js/vendor/bootstrap.js
2015-05-11 18:20     81112   s3://MASKED1/MASKED2/www.experimentlabs.com/static/js/vendor/jquery-1.10.1.js

2 个答案:

答案 0 :(得分:1)

查看Cactus

您也可以使用任何其他静态站点生成器。 Here有很多可供选择。

答案 1 :(得分:0)

另请参阅Python Flask微框架。 它非常简单轻便。