hi, I used python to write function. I tested basic code, everything is okay. build completed. But, when I use 'from appwrite.client import Client' , I see Internal Runtime error. on Appwrite panel. What is the problem?
could you share the code you're using in the function?
@safwan sure
import random from appwrite.client import Client
def main(req, res): payload = req.payload or 'No payload provided. Add custom data when executing function.'
secretKey = req.variables.get(
'SECRET_KEY',
'SECRET_KEY variable not found. You can set it in Function settings.'
)
randomNumber = random.random()
return res.json({
'message': 'Hello from Appwrite!',
'payload': payload,
'secretKey': secretKey,
'randomNumber': randomNumber
})
When I add 'from appwrite.client import Client', it will be problem
did you add the appwrite package as a dependency to your function?
Recommended threads
- Project in AppWrite Cloud doesn't allow ...
I have a collection where the data can't be opened. When I check the functions, there are three instances of a function still running that can't be deleted. The...
- Get team fail in appwrite function
I try to get team of a user inside appwrite function, but i get this error: `AppwriteException: User (role: guests) missing scope (teams.read)` If i try on cl...
- Function in Node.JS to monitor events ar...
Hello everyone. I'm creating my first Node.JS function, but I don't have much experience with node and javascript. I'm trying to create a function, that monito...