What I want to do is pretty straightforward. I have a site powered by django. I want to have the site automatically post to twitter any time a new object is created and saved in the database. What is the absolute best way to do this?
One way is the following:
First, handle the post_save
signal from Django. Note that post_save
passes your handler a boolean parameter created
to let you know whether it's a new object that was saved.
Then, call the python-twitter
library's PostUpdate
function within your handler to notify on twitter:
Try using the function post_to_twitter()
from this: http://www.djangosnippets.org/snippets/1339/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With