> Thanks for taking a look. Still feeling my way on what I need to post
> to be most helpful.
I'd say you did correctly, describing the problem and not
flooding the list with 20 diff. config files and code...if the
list needs more info, we usually ask for it :) However, for
future reference, full tracebacks (redacted for volumnous or
confidential data) and exact error messages can be helpful.
The OS/shell info was to ensure that for some reason your
os.getlogin() call wasn't borked for some reason.
> File "/home/mwaite/django-projects/data/app/models.py" in save
> 170. api = twitter.Api()
it looks like the problem resides here. From what I see (not
knowing anything about the twitter API, this answer may register
a 10 on the bogosity meter), it looks like you're instantiating
the Api() object with no parameters, and then on your following
line, throwing away your previous instance ("api") and then
*re*-instantiating it with parameters.
api = twitter.Api()
api = twitter.Api(username='username',password='password')
status = api.PostUpdate('My update message here')
It seems as though the twitter API is kind enough to try and find
your username via shell variable and system calls if you don't
pass it in, but it chokes on something. As far as I can tell,
you can simply delete the first line.
> The twitter._GetUsername() doesn't work however:
>
>>>> >>> twitter._GetUsername()
> Traceback (most recent call last):
> File "<stdin>", line 1, in <module>
> AttributeError: 'module' object has no attribute '_GetUsername'
It failed because, not surprisingly, the "twitter" module doesn't
have "_GetUsername". The above traceback indicates that it
should be the Api() object that likely has the _GetUsername
method. Thus, from a raw python prompt, I'd try just what you
intend to do in code:
>>> import twitter
>>> t = twitter.Api(username='username', password='password')
>>> status = t.PostUpdate('Testing from python shell')
>>> print status
to ensure it works as expected, and then, if curious, you can try
>>> print t._GetUsername()
> I'm not sure what user the python process is running as. It's
> a local install, running on Apache/ mod_python so I'm guessing
> that it's running as me. Tell me how I can figure it out and
> I'll tell you for sure.
usually in this setup, apache runs as a web-user, usually
something like "www", "www-data", "_www", or "apache". However,
for the time being, I'd say this issue is semi-moot.
-tim
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---