How can I use response.render() functionality when there is no response object?

24 views
Skip to first unread message

Lisandro

unread,
Mar 15, 2016, 6:34:28 AM3/15/16
to web2py-users
I have an html file template, and I would like to render it with some variables.
Normally I would do somethink like this:

response.render('path/to/template.html', dict=(var1='value1', var2='value2'))

However, I need to do it from scheduler environment, so there is no response object present.
Is there a way to use the render functionality without having the response object?

Thanks in advance!

Lisandro

unread,
Mar 15, 2016, 6:37:09 AM3/15/16
to web2py-users
I've figured it out, this is the way:

from gluon.template import render

Sorry to bother :P
Reply all
Reply to author
Forward
0 new messages