【发布时间】:2022-06-17 06:08:13
【问题描述】:
我的设置
from decouple import config
GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE = config("GOOGLE_DRIVE_STORAGE_JSON_KEY_FILE_CONTENTS")
我正在尝试为我的 django 项目设置 gdstorage,但没有根据文档中的说明获得 json 文件,因此我复制了密钥并将其放在我的环境变量中,但它仍然抛出此错误。
MyErrorMessage
gd_storage = GoogleDriveStorage()
File "C:\Users\username\.virtualenvs\vicsite-3EqYD9rF\lib\site-packages\gdstorage\storage.py", line 160, in __init__
credentials = Credentials.from_service_account_file(
File "C:\Users\username.virtualenvs\vicsite-3EqYD9rF\lib\site-packages\google\oauth2\service_account.py", line 238, in from_service_account_file
info, signer = _service_account_info.from_filename(
File "C:\Users\username.virtualenvs\vicsite-3EqYD9rF\lib\site-packages\google\auth\_service_account_info.py", line 72, in from_filename
with io.open(filename, "r", encoding="utf-8") as json_file:
FileNotFoundError: [Errno 2] No such file or directory: '78a23bb0124ac97ec7404104ae37dccffe33846a'
【问题讨论】:
标签: python django google-drive-api