我有一個api,我正在使用我正在進行的項目。我得到了客戶端ID的一個關鍵錯誤,我必須通過它才能調用API。我正在使用的api是Synapse。如果有人知道是什麼引發了錯誤,或者我可以如何解決這個關鍵錯誤,那將會是一種幫助......這是完整的錯誤。關鍵錯誤= client_id - django
KeyError at/
'client_id_...6YiBl'
Request Method: GET
Request URL: http://127.0.0.1:8000/
Django Version: 1.8.6
Exception Type: KeyError
Exception Value:
'client_id_...YiBl'
Exception Location: C:\Users\OmarJandali\AppData\Local\Programs\Python\Python36\lib\os.py in __getitem__, line 669
Python Executable: C:\Users\OmarJandali\AppData\Local\Programs\Python\Python36\python.exe
Python Version: 3.6.1
Python Path:
['C:\\Users\\OmarJandali\\Desktop\\opentab\\opentab',
'C:\\Users\\OmarJandali\\AppData\\Local\\Programs\\Python\\Python36\\python36.zip',
'C:\\Users\\OmarJandali\\AppData\\Local\\Programs\\Python\\Python36\\DLLs',
'C:\\Users\\OmarJandali\\AppData\\Local\\Programs\\Python\\Python36\\lib',
'C:\\Users\\OmarJandali\\AppData\\Local\\Programs\\Python\\Python36',
'C:\\Users\\OmarJandali\\AppData\\Local\\Programs\\Python\\Python36\\lib\\site-packages']
這裏是代碼:
import os
from synapse_pay_rest import Client
args = {
'client_id': os.environ['client_id_...YiBl'],
'client_secret': os.environ['client_secret_...C3IF'],
'fingerprint': '599378e9a63ec2002d7dd48b',
'ip_address': '127.0.0.1',
'development_mode':True,
'logging':False
}
client = Client(**args)
我已經編輯出了代碼中的完整密碼/ id。我建議在Synapse中使它們失效併發布新的證書。 – birryree
謝謝。我意識到後,我有我的客戶端ID和客戶端的祕密...大聲笑 –