我是TurboGears的新手,剛剛在虛擬環境中安裝TG2開發。我沿着quickstart guide以下,並已通過TurboGears 2 quickstart立即顯示錯誤
paster quickstart
成功地建立了一個HelloWorld,我開始在服務器和導航網頁瀏覽器到localhost:8080
難道你不知道吧,我馬上得到一個錯誤,而不是文檔建議我應該看到的歡迎消息。
錯誤讀取:
AttributeError: 'AcceptLanguage' object has no attribute 'best_matches'
這裏的痕跡:
URL: http://localhost:8080/
File 'C:\\VirtualEnv_1\\lib\\site-packages\\weberror-0.10.3-py2.7.egg\\weberror\\evalexception.py', line 431 in respond
app_iter = self.application(environ, detect_start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\beaker-1.6-py2.7.egg\\beaker\\middleware.py', line 73 in __call__
return self.app(environ, start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\beaker-1.6-py2.7.egg\\beaker\\middleware.py', line 155 in __call__
return self.wrap_app(environ, session_start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\routes-1.12.3-py2.7.egg\\routes\\middleware.py', line 131 in __call__
response = self.app(environ, start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\wsgiapp.py', line 107 in __call__
response = self.dispatch(controller, environ, start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\wsgiapp.py', line 312 in dispatch
return controller(environ, start_response)
File 'C:\\VirtualEnv_1\\Scripts\\HelloWorld\\helloworld\\lib\\base.py', line 27 in __call__
return TGController.__call__(self, environ, start_response)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 211 in __call__
response = self._dispatch_call()
File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 162 in _dispatch_call
response = self._inspect_call(func)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\pylons-1.0-py2.7.egg\\pylons\\controllers\\core.py', line 105 in _inspect_call
result = self._perform_call(func, args)
File 'C:\\VirtualEnv_1\\lib\\site-packages\\turbogears2-2.1.3-py2.7.egg\\tg\\controllers\\dispatcher.py', line 230 in _perform_call
setup_i18n()
File 'C:\\VirtualEnv_1\\lib\\site-packages\\turbogears2-2.1.3-py2.7.egg\\tg\\i18n.py', line 61 in setup_i18n
pylons.request.accept_language.best_matches())) AttributeError的: 'AcceptLanguage' 對象有沒有屬性 'best_matches'
當我安裝它時,我是否搞亂了一些東西,或者這是TurboGears的問題?
編輯:我創造了我命名GoodnightMoon,這次沒有真子模板選項(這是設置的唯一區別)第二個項目,我也得到了同樣的錯誤:
'AcceptLanguage' object has no attribute 'best_matches'
不幸的是這個問題的我只能找到一個與此錯誤完全相關的web search。
有沒有其他線索我可以使用並提供給stackoverflow來協助回答這個問題?
根據Michael Pederson的建議,我研究了國際化。我有一個只有一個子目錄的i18n目錄,名爲ru(俄文,我假設)。我正在研究英文默認系統和瀏覽器。
我用什麼最新TG2發行版是這個問題,訴2.1.3的時間,tg.devtools的2.1.x
這聽起來像國際化的問題,說實話取代的lib/python2.7/site-packages中/的WebOb內的文件。瀏覽器中的默認語言是什麼?您正在使用哪個版本的TurboGears?你能提供一個鏈接到你正在遵循的確切教程嗎?一些較舊的可能會給你最糟糕的TG指令。 – 2011-10-21 05:12:10
我也在這裏:任何答案? – alonisser