[web2py] Displaying images from web2py as a server

2023-10-08 Thread mostwanted
 I have a little functionality here where i'm pulling information from a 
web2py server and displaying it on a kivy app for the user, all the other 
details are displaying but the image is failing to display & I get the 
error:* [ERROR  ] [AsyncImage  ] Not found 
.*

What am I doing wrong? How do I get the image to display coz its clearly 
there?

*WEB2PY CODE:*
@request.restful()
def api_list_clients():
def GET(*args, **vars):
query = db().select(db.person.ALL)
return response.json(dict(clients=query.as_list()))
return locals()

*KIVY CODE:*
def read_from_server(self):
self.root.ids.display_screen.clear_widgets()
response = requests.get("
http://localhost:8000/clients/default/api_list_clients;)
if response.status_code == 200:
print("Response content:", response.content)
try:
data = response.json()
clients = data.get("clients", [])
for client in clients:
name = client.get("name")
surname = client.get("surname")
cell = client.get("cell")
email = client.get("email")
*image_url = client.get("image")  *
details_layout = BoxLayout(orientation='vertical', 
spacing=10)
name = MDLabel(text=name, halign="center")
surname=MDLabel(text=surname, halign='center')
cell=MDLabel(text=cell, halign='center')
email=MDLabel(text=email, halign='center')
details_layout.add_widget(name)
details_layout.add_widget(surname)
details_layout.add_widget(cell)
details_layout.add_widget(email)
*image = AsyncImage(source=image_url)*
*details_layout.add_widget(image)*
self.root.ids.display_screen.add_widget(details_layout)
except json.JSONDecodeError as e:
print("Error parsing JSON response:", e)
elif response.status_code == 204:
# Handle empty response (No Content)
print("No clients found.")
else:
print("Failed to read from server. Status code:", 
response.status_code)

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/7f66b3bf-56ce-46fe-8567-691bf0655ee6n%40googlegroups.com.


[web2py] web2py 2.25.1

2023-10-08 Thread Massimo Di Pierro
Hello everybody,

A new version of web2py, 2.25.1, is out. 

It contains some bug fixes, #2468 #2468 #2236, http headers sanitization, 
and fixes this vulenarbility https://jvn.jp/en/jp/JVN80476432/ (to be 
published soon).

The vulnerabily does not affect most users. It is only in the optional 
MessageBoxHandler for logging when using Tkinter. I do know think anybody 
is was using it.

I am reviewing some old PRs and I may have another version out today 
including those fixes as well. Sorry I have been slow but as you know, I am 
spending more time on py4web than web2py these days. 

Massimo


-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/web2py/07157d0b-2486-47df-b83a-36d5e1282866n%40googlegroups.com.