title: Django POST 403 Forbidden
body: <p>I try to develop chat application with django. Everything works ok, but I have a strange problem. POST 127 0 0 1/ 403 (FORBIDDEN) - every few seconds.</p>
  
  <p>my message_box.js:</p>
  
  <pre><code>// load messages every 1000 milliseconds from server.
  load_data = {'fetch':1};
  window.setInterval(function(){
   $.post('/', load_data,  function(data) {
      $('.message_box').html(data);
      var scrolltoh = $('.message_box')[0].scrollHeight;
      $('.message_box').scrollTop(scrolltoh);
   });
  }, 1000);
  
  $("#shout_message").keypress(function(evt) {
      if(evt.which == 13) {
              var iusername = $('#shout_username').val();
              var imessage = $('#shout_message').val();
              post_data = {'username':iusername, 'message':imessage};
              $.post('/', post_data, function(data) {
                  $(data).hide().appendTo('.message_box').fadeIn();
                  var scrolltoh = $('.message_box')[0].scrollHeight;
                  $('.message_box').scrollTop(scrolltoh);
                  $('#shout_message').val('');
              }).fail(function(err) {
              alert(err.statusText);
              });
          }
  });
  </code></pre>
  
  <p>urls.py:</p>
  
  <pre><code>    url(r'^$', chat_index, name='home'),
  </code></pre>
  
  <p>html:</p>
  
  <pre><code>&lt;form action="." method="POST"&gt;{% csrf_token %}
  &lt;div class="shout_box"&gt;
  &lt;div class="header"&gt;Max Shout Box &lt;div class="close_btn"&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;
    &lt;div class="toggle_chat"&gt;
    &lt;div class="message_box"&gt;
      &lt;/div&gt;
      &lt;div class="user_info"&gt;
      &lt;input name="shout_username" id="shout_username" type="text" placeholder="Your Name" maxlength="15" /&gt;
      &lt;input name="shout_message" id="shout_message" type="text" placeholder="Type Message Hit Enter" maxlength="100" /&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>I think problem in my views (can you help me fix this code?):</p>
  
  <pre><code>def chat_index(request):
      print(request.method)
      if request.method == "POST":
          print request.POST
      else:
          pass
      return render_to_response('base.html',
                                context_instance=RequestContext(request))
  </code></pre>
  
  <p>If it is possible to rewrite this form using ajax help me do it. Thanks.</p>