I'm trying to marry up Django and a python wrapper to the Twitter API
called Python-Twitter (http://code.google.com/p/python-twitter/) to
trigger a status change on saving an item to a database. It looks
something like this:
def save(self):
if self.makepublic:
api = twitter.Api()
api = twitter.Api(username='username',
password='password')
status = api.PostUpdate('My update message here')
else:
pass
super(Modelname, self).save()
However, when I save the record in the Django admin, I get this:
[Errno 25] Inappropriate ioctl for device
Exception Location: build/bdist.linux-i686/egg/twitter.py in
_GetUsername, line 1498
The section of code mentioned in the error from twitter.py is here:
def _GetUsername(self):
'''Attempt to find the username in a cross-platform fashion.'''
return os.getenv('USER') or \
os.getenv('LOGNAME') or \
os.getenv('USERNAME') or \
os.getlogin() or \
'nobody'
Anyone got any guesses? I'm so much of a python noob that I can't even
spell half these things. Any suggestions are most appreciated.
Matt
Matthew Waite
politifact.com | mattwaite.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" 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/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---