Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8486485
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T20:57:28+00:00 2026-06-10T20:57:28+00:00

i get the 405: Method Not Allowed, so where is the problem, it’s a

  • 0

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

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 < 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") 

and the template:

<form id="formvente" name="formvente"  method="post" action="/vendre" enctype="multipart/form-data"> 
{% raw xsrf_form_html() %} 
<label for="namep">Le nom du Produit</label> 
<input type="text" name="namep" required title="vous devez mettre le nom du produit" placeholder="exemple: peugeot 206"> 
<label for="prix">Son prix (en Dinars Alg&eacute;rien)</label> 
<input type="number" name="prix" required title="vous devez mettre le prix en chiffre (en Dinars Alg&eacute;rien)" placeholder="exemple: 800000"> 
<label for="photo">Une photo de votre produit</label> 
<input name="photo" type="file"> 
<label for="description">Veuillez donner une d&eacute;scription du produit (maximum 160 caract&egrave;res)</label> 
<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)"></textarea> 
<meter name="shower" min="1" max="160" value="1"id="shower" low="30" high="140">afficher son etat</meter> 
<input id="vendre" type="submit" value="Mettre en Vente"/> 
                            </form> 

and i have simplified the handler to this

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") 

always the method error it dident check the handler content at all
(else it raised and error when not finding email)!

  • 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?
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T20:57:30+00:00Added an answer on June 10, 2026 at 8:57 pm

    SOLVED!
    it seems that the problem is coming from the picture handler; in the URLSpec, IT MUST BE THE LAST ONE IN THE LIST

    url = [
    ...,
    ...,
    ...,
    (r"/(?P<picture>.*)", handlers.PictureHandler)]
    

    this is why when using GET method return errors concerning picture!
    hope this will help, and thank you 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I submit the JSP form, I get 405 - Request method 'POST' not
What are the causes for the the error NetworkError: 405 Method Not Allowed I
Our facebook page is saying: Error Summary HTTP Error 405.0 - Method Not Allowed
GET is a convenient method to post the form id, post the website id
Im having problems using HttpWebRequest and POST method to send info to a third
I am not able to submit a post request as i get back the
Get class from div inside an li and add to the same li. The
The get works fine and able to post to the database with a test
[using Apache Tomcat/7.0.27] It seems I only get this error ( HTTP Status 405
code snippet: @RequestMapping(method = RequestMethod.POST)//, headers = content-type=application/x-www-form-urlencoded) public ModelAndView create(@RequestBody UserAccountBean account) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.