我有一個網站使用Flask。主程序很長,所以我用a paste來顯示代碼。當我用./site serve --debug
運行它時,它可以很好地工作,但我無法用燒瓶冷凍它。我有這樣的錯誤:燒瓶凍結不起作用,而燒瓶是好的
$ ./site build
Building website...
./site:240: MimetypeMismatchWarning: Filename extension of u'sitemap.xml' (type application/xml) does not match Content-Type: text/html; charset=utf-8
freezer.freeze()
Traceback (most recent call last):
File "./site", line 346, in <module>
parser.dispatch()
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/helpers.py", line 53, in dispatch
return dispatch(self, *args, **kwargs)
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 123, in dispatch
for line in lines:
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 199, in _execute_command
for line in result:
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/argh/dispatching.py", line 182, in _call
result = args.function(*positional, **keywords)
File "./site", line 240, in build
freezer.freeze()
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/flask_frozen/__init__.py", line 140, in freeze
new_filename = self._build_one(url)
File "/home/guillaume/nicolas.perriault.net/env/lib/python2.7/site-packages/flask_frozen/__init__.py", line 250, in _build_one
% (response.status, url))
ValueError: Unexpected status '500 INTERNAL SERVER ERROR' on URL /403.html
如果我刪除有關site.py 403.html的一部分,我也有同樣的錯誤與404,然後500,然後contact.html,然後/。我找不到原因。有沒有人有想法?
什麼在您的模板?可能是一些'base.html'?嘗試在運行'./site serve --debug'時尋址'/ 403.html'。有沒有錯誤? – twil
當我去'403.html' 沒有錯誤我有一個'base.html',但我不認爲這個錯誤來自他。你想看代碼嗎? –