python - tornado URL and HTML form -



python - tornado URL and HTML form -

i'm using tornado , want insert mongodb values in html form.

in html file have form this:

<form method="get" >

with 2 textbox , submit button. , don't know set "action"

i have handler class function called "post" bellow:

class myhandler(tornado.web.requesthandler): def post(self): name = self.get_argument("name", "") index = self.get_argument("index","") .... code updating mongodb

i have file called baseurl.py contains:

(/admin/edit[/]?',myhandler )

but seems "post" function in myhandler not execute. please give me advice how set urls , form actions?

your post method isn't called because form specifies method="get". alter method="post" , it'll work.

if action empty browser submit request current page, if have handler serving form @ same url don't need specify it.

python html tornado

Comments

Popular posts from this blog

model view controller - MVC Rails Planning -

ruby on rails - Devise Logout Error in RoR -

html - Submenu setup with jquery and effect 'fold' -