我在的web2py模塊的Python函數來發送e-mails.It有以下代碼web2py中使用的模塊
message = response.render('scheduler/connectionmessage.html',cont)
我得到的錯誤
<type 'exceptions.NameError'> name 'response' is not defined"
我怎樣才能讓渲染可用於模塊?目標是在模塊下有幾個這樣的腳本,並通過調度器從控制器下的存根執行它們。 更多的代碼 -
def send_email_invites():
from gluon import *
from gluon.template import render
db = current.db
......<execute query and populate dictionary>
message = response.render('scheduler/connectionmessage.html',cont)
也差不多了。
你能告訴我們模塊代碼嗎? –