Hi Jeff, thanks for your interest.
Yes I'm sure about that because my program works well when is in
development.
This is the output of my client script:
file result/tmp.png
host localhost:8080
selector /bulkupload
fields [('part1', '0'), ('part2', '0'), ('part3', '0')]
result 2
...
result/tmp.png
localhost:8080
/bulkupload
[('part1', '0'), ('part2', '0'), ('part3', '1')]
3
result/tmp.png
localhost:8080
/bulkupload
[('part1', '0'), ('part2', '0'), ('part3', '2')]
4
result/tmp.png
localhost:8080
/bulkupload
[('part1', '0'), ('part2', '0'), ('part3', '3')]
5
The log of the development server is:
INFO 2008-11-12 16:23:58,736 __init__.py] Server:
appengine.google.com
INFO 2008-11-12 16:23:59,326 __init__.py] Running application my-
mood on port 8080: http://localhost:8080
INFO 2008-11-12 16:24:23,802 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:23,804 __init__.py] Detected manual
index.yaml, will not update
INFO 2008-11-12 16:24:23,966 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:24,104 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:24,257 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:24,406 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:24,559 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:24,735 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:25,054 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
INFO 2008-11-12 16:24:25,278 __init__.py] "POST /bulkupload HTTP/
1.0" 200 -
So this show me that all is going fine.
But after un update to the GAE server, this is the result on my client
script:
file result/tmp.png
host my-mood.appspot.com
selector /bulkupload
fields [('part1', '0'), ('part2', '0'), ('part3', '0')]
result
<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>405 Method Not Allowed</title>
<style><!--
body {font-family: arial,sans-serif}
div.nav {margin-top: 1ex}
div.nav A {font-size: 10pt; font-family: arial,sans-serif}
span.nav {font-size: 10pt; font-family: arial,sans-serif; font-weight:
bold}
div.nav A,span.big {font-size: 12pt; color: #0000cc}
div.nav A {font-size: 10pt; color: black}
A.l:link {color: #6f6f6f}
A.u:link {color: green}
//--></style>
<script><!--
var rc=405;
//-->
</script>
</head>
<body text=#000000 bgcolor=#ffffff>
<table border=0 cellpadding=2 cellspacing=0 width=100%><tr><td
rowspan=3 width=1% nowrap>
<b><font face=times color=#0039b6 size=10>G</font><font face=times
color=#c41200 size=10>o</font><font face=times color=#f3c518
size=10>o</font><font face=times color=#0039b6 size=10>g</font><font
face=times color=#30a72f size=10>l</font><font face=times
color=#c41200 size=10>e</font> </b>
<td> </td></tr>
<tr><td bgcolor="#3366cc"><font face=arial,sans-serif
color="#ffffff"><b>Error</b></td></tr>
<tr><td> </td></tr></table>
<blockquote>
<H1>Method Not Allowed</H1>
The request method <code>POST</code> is inappropriate for the URL
<code>/bulkupload</code>.
<p>
</blockquote>
<table width=100% cellpadding=0 cellspacing=0><tr><td
bgcolor="#3366cc"><img alt="" width=1 height=4></td></tr></table>
</body></html>
Thanks for your help.
Cheers.
On 11 nov, 21:18, Jeff S <[EMAIL PROTECTED]> wrote:
> Hi Marcelo,
>
> Are you sure that the selector requested by the client is mapping to
> the BulkUpload RequestHandler? The error that your client receives
> sounds like the default error when the invoked request handler doesn't
> have a post method.
>
> Cheers,
>
> Jeff
>
> On Nov 10, 10:46 am, Marcelo <[EMAIL PROTECTED]> wrote:
>
> > Hi there.
>
> > I'm trying to upload some data to datastore, I can't use CSV bulk
> > uploader because my data is not just text. Part of the data is an
> > image. So I decide to make a python script to call a POST method on
> > the server and go saving each row of my data.
>
> > I test on local environment and works well, but after upload the
> > application, my script receive an error 405 Method POST not allowed.
>
> > I define my request class on server:
>
> > class BulkUpload(webapp.RequestHandler):
> > def post(self):
> > ....
> > model.put()
>
> > On the client i'm using a script to call a url
>
> > content_type, body = encode_multipart_formdata(fields, files)
> > #here i put all my data
> > h = httplib.HTTP(host)
> > h.putrequest('POST', selector)
> > h.putheader('content-type', content_type)
> > h.putheader('content-length', str(len(body)))
> > h.endheaders()
> > h.send(body)
> > errcode, errmsg, headers = h.getreply()
>
> > Thanks for your help.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---