2015年5月22日 星期五

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
 就成功了

  參考

沒有留言:

張貼留言