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
- Feedback and Deployment Challenges with ...
Hello world!, I've been developing a project using FastAPI in Python, and I was considering deploying it through Appwrite Functions. However, I encountered a f...
- Bulk feature status
Hi there, I am using version 1.7.4 self hosted and wanted to use the bulk operations in a dart function. I saw that in the dart_appwrite sdk version 16.1.0 it ...
- CORS preflight returns 500 on Dart funct...
Hey everyone 👋 I’m running a Dart cloud function, Every time I respond to a preflight (OPTIONS) request, I get a 500 internal error, and the logs show: ```NoSu...