我收到一个错误[错误:ENOENT:没有这样的文件或目录,打开'D:\discortbot\credentials.json']
<块引用>加载客户端机密文件时出错:[错误:ENOENT:没有此类文件或
目录,打开 'D:\discortbot\credentials.json'] { errno: -4058,
代码:'ENOENT',系统调用:'open',路径:
'D:\discortbot\credentials.json' }
我的代码如下,我在 Windows 机器上工作。
serializers.py:
class IngredientPostSerializer(serializers.ModelSerializer):
recipes = serializers.SerializerMethodField()
def get_recipes(self, obj):
recipes = Recipe.objects.filter(user_id=self.request.user.id)
return recipes
class Meta:
model = Ingredient
fields = '__all__'
我是新手,所以请帮助我。