I'm trying to use the sendgrid Python API as a module in web2py. After testing it successfully from the command line, I dropped it into my modules folder, but as soon as I try to import sendgrid into my controller file, I get:
File "applications/test/modules/sendgrid/__init__.py", line 4, in
<module>
del sendgrid, message NameError: name 'sendgrid' is not defined
Looking at the __init__.py
file, I noticed they're doing * imports on the module level, which I've seen cause problems before, but I'm not sure what the issue is.
sendgrid/__init__.py
:
from sendgrid import *
from message import *
del sendgrid, message
__version__ = "0.1.0"
version_info = (0, 1, 0)
sendgrid api: https://github.com/sendgrid/sendgrid-python