🐛 Bug Report: can't import certain python built-ins for functions · Issue #5626 · appwrite/appwrite · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a manual deployment and this was my main.py file: (took from the docs)
If I remove the requests module it works else not :(
importrandomimportrequestsdefmain(req, res):
payload=req.payloador'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()
trigger=req.variables['APPWRITE_FUNCTION_TRIGGER']
returnres.json({
'message': 'Hello from Appwrite!',
'payload': payload,
'randomNumber': randomNumber,
'trigger': trigger
})
👍 Expected behavior
I am trying to implement a function where on event trigger like collection update I will send some data to a server but I noticed that it's failing every time....on doing a bit of trial and error I realized that it's not allowing me to import 'requests' module....without it everything works fine...
👎 Actual Behavior
It's failing because of the requests import...
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
Appwrite cloud functions with Python runtime
👀 Have you spent some time to check if this issue has been raised before?
👟 Reproduction steps
I did a manual deployment and this was my main.py file: (took from the docs)
If I remove the requests module it works else not :(
👍 Expected behavior
I am trying to implement a function where on event trigger like collection update I will send some data to a server but I noticed that it's failing every time....on doing a bit of trial and error I realized that it's not allowing me to import 'requests' module....without it everything works fine...
👎 Actual Behavior
It's failing because of the requests import...
🎲 Appwrite version
Appwrite Cloud
💻 Operating system
Windows
🧱 Your Environment
Appwrite cloud functions with Python runtime
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: