FTR, as of 2025, it's been 14 years that the bottle.response.remote_addr property was added, and it does exactly what @ron-rothman shared. It is just less code to type.
bottle.response.remote_addr