title: JQuery + AJAX + Django = CSRF ?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/6506897/csrf-token-missing-or-incorrect-while-post-parameter-via-ajax-in-django">&quot;CSRF token missing or incorrect&quot; while post parameter via AJAX in Django</a>  </p>
  </blockquote>
  
  
  
  <p>I wanted to send login data by AJAX to authenticate user, but it wasn't possible because of CSRF. Could You tell me what to add to my code to make it woking?</p>
  
  <p>my JavaScript file:</p>
  
  <pre><code>$("#login").live("click", function() {
      var username = $(".login_username").val();
      var password = $(".login_password").val();
  
      $.ajax({
          url: "/login",
          type: "POST",
          data: {
              username: username,
              password: password
          },
          cache: false,
          success: function(tekst) {
              alert(tekst);
          }
      });
  });
  </code></pre>