not sure if just a typo, but your html looks incorrect.
you have :
<form method=post action=blog>
should be :
<form method="post" action="blog">
same for your other attributes, i.e. name="names", not name=names
hope that helps
also, in your class index, are those two single quotes in your GET method
or just one double quote left open?
On Thursday, April 4, 2013 8:58:51 AM UTC-6, Claudio Dusan Vega Ozuljevich
wrote:
>
> Hi guys, I got an error 405 as you can read, here is my code and my guess
> of what's wrong. The code is pretty basic, they are 3 files, main.py,
> blog.py, and form.html
>
> main.py --
>
> import web
> import blog
>
> urls = (
> "/blog", blog.app_blog,
> "/(.*)", "index"
> )
>
> web.config.debug = False
> app = web.application(urls, locals())
> session = web.session.Session(app, web.session.DiskStore('sessions'))
> render = web.template.render('views/', globals = {'session': session})
>
> class index:
>
> def GET(self, path):
> session.names = ''
> session.surnames = ''
> session.nin = ''
> session.address = ''
> session.phone = ''
> session.email = ''
> return render.form()
>
>
> if __name__ == "__main__":
> app.run()
>
>
> --
>
> blog.py --
>
> import web
> urls = (
> "", "reblog",
> "/", "blog"
> )
>
> class reblog:
> def GET(self): raise web.seeother('/')
> '
>
> class blog:
> def GET(self):
> return "getblog"
> def POST(self):
> return "postblog"
>
> app_blog = web.application(urls, locals())
>
> -- form.html--
>
> <form method=post action=blog>
> <ul>
> <li><input name=names required maxlength=24 placeholder="Name"
> value="$session.names"></li>
> <li><input name=surnames required maxlength=24
> placeholder="Surname" value="$session.surnames"></li>
> <li><input name=nin requiered maxlength=12 placeholder="RUT"
> value="$session.nin"></li>
> <li><input name=address required maxlenght=64
> placeholder="Address" value="$session.address"></li>
> <li><input name=phone required maxlength=10 placeholder="Phone"
> value=$session.phone></li>
> <li><input name=email type=email required maxlenght=254
> placeholder="email" value=$session.email></li>
> <li><input name=password type=password required
> placeholder="password"></li>
> <li><input name=confirmpassword type=password required
> placeholder="Confirmar pass"></li>
> <li><input type=submit value="registrarse"></li>
> </ul>
> </form>
> ---
>
>
>
> The thing is that the user inputs are not use by the POST, rather it gives
> me an error 405 exactly like this:
> "HTTP/1.1 POST /blog" - 405 Method Not Allowed
>
> and the browser prints None.
>
> Please give me a hand guys, this is pretty frustrating, if you know what I
> mean.
>
> Thanks beforehand.
>
> Cheers.
>
--
You received this message because you are subscribed to the Google Groups
"web.py" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/webpy?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.