在裝psycopg2的時候碰到的奇怪問題。error: Setup script exited with error: Unable to find vcvarsall.bat在辦公室及其上通過easy_install psycopg2安裝psycopg2一切正常,但在家裡的機器上按照同樣的方法安裝卻出錯,報找不到vcvarsall.bat,真是奇怪。比較了一下,兩台機器的唯一區別是辦公室機器上裝了Visual studio 2008,難道這個有關係?如非特別需要,絕對不會安裝Visual
Bug 1:在使用webhelpers 1.0 的paginate時碰到了TypeError("Sorry, your collection type is not supported by the paginate module. " "You can either provide a list, a tuple, an SQLAlchemy 0.4 select object or an " "SQLAlchemy 0.4 ORM-query
為了在使用development environment顯示static files,比如css,images等等,參考http://docs.djangoproject.com/en/dev/howto/static-files/說明在settings.py添加Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/-->STATIC_DOC_ROOT =
開發網路應用程式有時是單調乏味的,因為我們對於某些操作(或者模式)重複來重複去,重複的事情做的多了也就覺得乏味了。在Django中,這類常見的操作都已經被抽象為Generic Views(通用視圖)。借用Generic Views,我們不用寫一行python代碼就可以提供一些常見的view操作。比如:Code highlighting produced by Actipro CodeHighlighter
在Win7下將Sphinx安裝成windows服務時碰到如下錯誤:Install the searchd system as a Windows service:C:\Sphinx\bin> C:\Sphinx\bin\searchd --install --config C:\Sphinx\sphinx.conf.in --servicename SphinxSearchInstalling service...FATAL: OpenSCManager() failed: code=5,
將代碼升級至pylons1.0,原本運行良好的程式報出:AttributeError: 'ContextObj' object has no attribute 'tabs' 異常,經過查詢資料得知是pylons1.0相比較0.97做了一些調整,pylons 1.0預設情況下tmpl_context將不再是AttribSafeContextObj,也就是說:訪問不存在的屬性將產生AttributeError異常,為使用attribute-safe tmpl_context,可以更改config/
在配置git server的時候,為達到同時妥善的支援windows和linux平台,需要配置core.autocrlf具體設定如下:core.autocrlf=inputcore.autocrlf具體解釋如下:core.autocrlfSetting this variable to "true" is almost the same as setting the text attribute to "auto" on all files except that text files are
在使用git提交python源碼的時候出現whitespace error: trailing space at end of line的錯誤,仔細分析一下源檔案,發現源碼中的確存在行尾是空格的情況。按照常規,這樣的情況是不應該出現的,而且也是無意義的,所有行尾的空格都應該去掉才對。仔細分析了一下,有可能是常用的幾個python編輯器中某一個在處理trailing space的時候設定不對或者處理不當的問題:簡單測試了一下:Sublime Text2 預設情況下就處理 trailing