undefined

當要連線修改Firebase資料庫時:

from firebase import firebase
url =
'https://xxx.firebaseio.com/'
fb = firebase.FirebaseApplication(url, None)
fb.put(url+
"/test/", data={"name":"Ken"}, name="myKey")

 

會出現下述的錯誤:

  File "C:\Python27\lib\site-packages\firebase\firebase.py", line 72, in make_put_request

    response.raise_for_status()

  File "C:\Python27\lib\site-packages\requests\models.py", line 722, in raise_for_status

    raise HTTPError(http_error_msg, response=self)

requests.exceptions.HTTPError: 401 Client Error: Unauthorized

 

這是因為自己的firebase設定沒有開通權限,來到下述頁面進行權限開通:

python_firebase_1.jpg

改完並且點擊發佈後就可以重新執行Python,然後就不會出現錯誤的訊息了。

arrow
arrow

    葛瑞斯肯 發表在 痞客邦 留言(0) 人氣()