title: tornado dont accept the POST method
body: <p>i get the 405: Method Not Allowed, so where is the problem, it's a 
  post method since i want to send data to the server </p>
  
  <pre><code>class VendreHandler(BaseHandler): 
      @tornado.web.authenticated 
      def post(self): 
          self.db = conn["essog"] 
          user = self.get_secure_cookie("mechtari") 
          info = tornado.escape.json_decode(user) 
          email = info["email"] 
          namep = self.get_argument("namep") 
          prix = self.get_argument("prix") 
          description = self.get_argument("description") 
          date = datetime.datetime.now().date() 
          try: 
              photo = self.request.files['photo'][0]["body"] 
              try: 
                  avctype = self.request.files['avatar'][0]["content_type"] 
                  image = Image.open(StringIO.StringIO(buf=avat)) 
                  type = image.format 
                  (x, y) = image.size 
                  if x &lt; y: 
                     orientation = "portrait" 
                  else: 
                     orientation = "paysage" 
                  pref = str(time.time())
                  nomfi = pref.replace(".", "") 
                  nomfich = nomfi + "-" + self.request.files['avatar'][0]["filename"] 
                  self.fs = GridFS(self.db) 
                  avatar_id = self.fs.put(avat, content_type=avctype,filename=nomfich) 
              except IOError, TypeError: 
                  self.redirect("/error-im") 
          except KeyError: 
              nomfich = "nofile" 
              orientation = "paysage" 
              avctype = "image/jpeg" 
              avatar_id = '503ae8553a5f3a0dd8b9cb4c' 
      self.db.users.update({"email":email}, {"$set":{"produit_up.namep":namep,"produit_up.prix":prix,"produit_up.photo":photo_id, "produit_up.description":description,"produit_up.date":date, "produit_up.vendu":False}}) 
      self.redirect("/success") 
  </code></pre>
  
  <p>and the template: </p>
  
  <pre><code>&lt;form id="formvente" name="formvente"  method="post" action="/vendre" enctype="multipart/form-data"&gt; 
  {% raw xsrf_form_html() %} 
  &lt;label for="namep"&gt;Le nom du Produit&lt;/label&gt; 
  &lt;input type="text" name="namep" required title="vous devez mettre le nom du produit" placeholder="exemple: peugeot 206"&gt; 
  &lt;label for="prix"&gt;Son prix (en Dinars Alg&amp;eacute;rien)&lt;/label&gt; 
  &lt;input type="number" name="prix" required title="vous devez mettre le prix en chiffre (en Dinars Alg&amp;eacute;rien)" placeholder="exemple: 800000"&gt; 
  &lt;label for="photo"&gt;Une photo de votre produit&lt;/label&gt; 
  &lt;input name="photo" type="file"&gt; 
  &lt;label for="description"&gt;Veuillez donner une d&amp;eacute;scription du produit (maximum 160 caract&amp;egrave;res)&lt;/label&gt; 
  &lt;textarea name="description" id="description" rows="3" cols="60" required title="vous devez mettre une petite description" placeholder="escence, 2006, roulant 100000km, toutes options, siege en cuir"                                 onKeyDown="textCounter(document.formvente.description,160)"                                        onKeyUp="textCounter(document.formvente.description, 160)"&gt;&lt;/textarea&gt; 
  &lt;meter name="shower" min="1" max="160" value="1"id="shower" low="30" high="140"&gt;afficher son etat&lt;/meter&gt; 
  &lt;input id="vendre" type="submit" value="Mettre en Vente"/&gt; 
                              &lt;/form&gt; 
  </code></pre>
  
  <p>and i have simplified the handler to this </p>
  
  <pre><code>class VendreHandler(tornado.web.RequestHandler): 
      def post(self): 
          namep = 1 
          prix = 3 
          description = 43 
          date = 345 
          self.db = conn["essog"] 
          self.db.users.update({"email":email}, {"$set":{"produit_up.namep":namep,"produit_up.prix":prix, "produit_up.photo":photo_id, "produit_up.description":description,"produit_up.date":date, "produit_up.vendu":False}}) 
          self.redirect("/profil#vendu") 
  </code></pre>
  
  <p>always the method error it dident check the handler content at all 
  (else it raised and error when not finding email)! </p>
  
  <ul>
  <li>NB: is it because i've used the accodion effect (CSS3)? the page contains 3 parts: the profile, upload product, and search for product, and of course every part has its own handler; so the profile will call 
  a GET to get the user information and the avatar, and the upload product will make a POST to write product information to the server, and finally the search will make a GET to the server to search for the product. 
  so, am i making mistake? </li>
  </ul>