user1360869
user1360869

Reputation: 29

tweeting from my django app

I have the following jQuery code to tweet from my Django app. It's working perfectly as is, but is there a way to know if my current user has tweeted or not? I want to set a boolean attribute to true when the user tweets. Any ideas on how to do this?

!function(d,s,id,emp){
    var js,fjs=d.getElementsByTagName(s)[0];
    if(!d.getElementById(id)){
        js=d.createElement(s);
        js.id=id;
        js.src="//platform.twitter.com/widgets.js";
        fjs.parentNode.insertBefore(js,fjs);
        }}(document,"script","twitter-wjs");

Upvotes: 2

Views: 81

Answers (1)

machaku
machaku

Reputation: 1196

Since Javascript is runs in browser an Django is running on server side, I think you will have to make a request to your server that will tell Django the current user has tweeted, this means you will have to create a view that will handle that request.

Upvotes: 1

Related Questions