You forgot to assign to the variable "resource" in your script. For example:
# MyCoolWebApp.rpy import mygreatresource resource = mygreatresource.MyGreatResource()