2
我試着去建立瓶調試工具欄,但得到以下錯誤...瓶調試工具欄
todo.py
import sqlite3
import bottle
from bottle_debugtoolbar import DebugToolbarPlugin
from bottle import route, run, debug, template, request, error, PasteServer
config = {'DEBUG_TB_ENABLED': True,
'DEBUG_TB_INTERCEPT_REDIRECTS':True
}
plugin = DebugToolbarPlugin(config)
bottle.install(plugin)
錯誤
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1727, in wrapper
rv = callback(*a, **ka)
File "/usr/local/lib/python2.7/dist-packages/bottle_debugtoolbar/__init__.py", line 75, in wrapper
return self.process_response(content)
File "/usr/local/lib/python2.7/dist-packages/bottle_debugtoolbar/__init__.py", line 135, in process_response
and bottle.response.headers['content-type'].startswith('text/html')
File "/usr/local/lib/python2.7/dist-packages/bottle.py", line 1930, in __getitem__
def __getitem__(self, key): return self.dict[_hkey(key)][-1]
KeyError: 'Content-Type'
:謝謝......它的工作..但現在我沒有看到工具欄? – user1050619
@ user1050619 hm,查看答案的「UPD」部分。這是我用來測試的。 – alecxe
非常感謝..它的工作..我沒有在我的html頁面中的
標記......一旦我添加,我看到它正在顯示...... – user1050619