I am evaluating CAS for inclusion in a project I am working on, and I
am running into a couple of problems.
I seem to be having a problem with the model name "email.py", because
at least in my environment if it getting loaded before the normal
email python module. So, when I attempt to test just sending email
from the command line: (I have added a little __name__=='__main__ to
email.py to let me test my problem.
[onwir...@web81 models]$ python2.5 email.py
Traceback (most recent call last):
File "email.py", line 21, in <module>
email("[email protected]", "[email protected]", "my subject", "a messages")
File "email.py", line 7, in email
from smtplib import SMTP
File "/usr/local/lib/python2.5/smtplib.py", line 46, in <module>
import email.Utils
ImportError: No module named Utils
If I change the module name to say, email2.py, no more collision of
the names, and the email.Utils import goes fine.
Has this something to do with my Python path? I am not 100% clear on
how web2py loads up code, but I am guessing it is something along the
lines of everything it finds gets added. Though, I think this might
not be totally correct, since my email function in email2.py does seem
to work when I attempt a registration. Any thoughts?
My second question has to do with using CAS with web2y running behind
mod_wsgi. I ran into some problems (do to the above email issues) and
it turns out that there are some print statements to stdout during
error cases that mod_wsgi doesn't allow. So my question is: do I need
to configure wsgi differently, or should applications (including CAS)
steer away from writing to stdout? From my reading on the topic (I am
no mod_wsgi expert) it seems like stderr might work. Obviously,
logging rather than print statements might make more sense.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---