發表文章

參加pycon TW 2015

圖片

django test app error

練習 django test 的時候出現ㄧ些問題:  Creating test database for alias 'default'... Got an error creating the test database: permission denied to create database Type 'yes' if you would like to try deleting the test database 'test_finance', or 'no' to cancel  後來發現是我postgresql 的資料庫使用者沒給予創建資料庫的權限,進入postgresql的root下以下指令:  #ALTER USER django CREATEDB; //記得django要換成資料庫使用者的名字 然後 $ python manage.py test polls  就成功了   參考

唐人傳奇

從小就很喜歡看神怪之類的小說,比如 聊齋志異 , 太平廣記 ,,,等,最近聽到某部電影要上映,,,又讓我想起,,隋唐時的奇幻神怪誌,記得專科時有讀過一篇叫 崑崙奴 的武俠小說,被文中的武功高強和深藏功與名的故事情節所折服,這“崑崙奴”是出自唐人傳奇中所收編的小說,原作者叫: 裴鉶 ,裴鉶還有另外一篇小說叫 聶隱娘 ,也是屬於神怪風格的小說,其實我感覺隋唐時期真是中國史上充滿傳奇幻怪誌的時代,,國力強盛而又華夷混血.

vim常用指令

在ubuntu會先下 sudo apt-get install vim 以下是我較常忘記的指令 nG,n 為數字。移動到這個檔案的第 n 行。例如 20G 則會移動到這個檔案的第 20 行(可配合 :set nu) gg,移動到這個檔案的第一行,相當於 1G 啊! 0 或功能鍵[Home] 這是數字『 0 』:移動到這一行的最前面字元處 $ 或功能鍵[End] 移動到這一行的最後面字元處 參考 移動游標到現在位置下10行  esc 10 enter 移動游標到現在位置上10行 esc 10-

A true SSLContext object is not available

在ubuntu server 14.04 裡安裝 psycopg2 出現了 A true SSLContext object is not available.,,,, 參考 下了sudo apt-get install libffi-dev libssl-dev,再pip install psycopg2後 A true SSLContext object is not available 的訊息就不再出現了

買新鞋

圖片
最近因為 nike+ 用了1年3個月終於跑步達千k,所以買了新鞋慶祝一下,為了健康鼓勵自己繼續運動下去!

在ubuntu server 或 raspberry pi安裝psycopg2的錯誤訊息

 Error: You need to install postgresql-server-dev-X.Y for building a server-side extension or libpq-dev for building a client-side application.   ----------------------------------------     Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-v5ZnhD/psycopg2 如果一直出現以上的psycopg2要執行以下的指令 sudo pip install --upgrade setuptools sudo apt-get install python-psycopg2 sudo apt-get install libpq-dev 再裝psycopg2 pip install psycopg2 ***************************************** In file included from psycopg/psycopgmodule.c:27:0:     ./psycopg/psycopg.h:30:20: fatal error: Python.h: No such file or directory     compilation terminated.     error: command 'gcc' failed with exit status 1 如果一直出現以上的錯誤要執行以下的指令 sudo apt-get install python-dev 再裝psycopg2 pip install psycopg2 參考 參考