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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
One way is the following:
First, handle the
post_savesignal from Django. Note thatpost_savepasses your handler a boolean parametercreatedto let you know whether it’s a new object that was saved.Then, call the
python-twitterlibrary’sPostUpdatefunction within your handler to notify on twitter: