Curiously enough, my solution works when I run it locally in a test environment, but results in an error 405 on the GAE servers with the message:

The request method GET is inappropriate for the URL /Guestbook.py

So I'm a bit stumped again.

My solution was, when I made the web application project in Eclipse (using the Google plugin), and then converted it into a Pydev application using Jython, I copied the jython.jar into my war/WEB-INF/lib folder, and I made a war/WEB-INF/lib-python folder like modjy, with the Lib.zip and all.pth files it uses in their own examples, I set up the web.xml file with the python.path setting pointing to the lib-python folder, and I added your suggestion for the static-files option, with an include path of: "/Guestbook.py" (I'm trying to duplicate Google's example for Java apps, only in Jython). To make it work, I had to make a war/WEB-INF/guestbook folder, and put my Guestbook.py in that folder, and then I could point my browser to: http://localhost:8080/guestbook/Guestbook.py and it worked. When I tried to put it to the production server, it didn't work (even changing the include path like you suggested), either it tries to give me the python file to download, or it does the error I outlined above.


On Sat, Aug 1, 2009 at 1:25 PM, Josh Juneau <juneau001@gmail.com> wrote:
Cliff-

Can you share your solution with us?  It would be great to document.
The solution I showed you worked in my environment on the app engine
dev server.

Thanks

On 8/1/09, Cliff Hill <xlorep@darkhelm.org> wrote:
> I tried what you said, and it didn't work. however, I seem to have made it
> work now, without needing that. Thanks.
>
> On Sat, Aug 1, 2009 at 9:33 AM, Josh Juneau <juneau001@gmail.com> wrote:
>
>> Cliff-
>> I forgot to mention that your statically mapped files can be URLs as
>> well.
>>  So for testing purposes on your machine the appengine-web.xml that I
>> gave
>> you previously would work.  However, to deploy to the cloud you will need
>> to
>> use the URL to your .py files instead.  For instance:
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
>>     <application>MyJythonApp</application>
>>     <version>1</version>
>>     <static-files>
>>         <include path="http://localhost:8080/NewJythonServlet.py"/>
>>      </static-files>
>>     <sessions-enabled>true</sessions-enabled>
>> </appengine-web-app>
>>
>> Of course,
>> when you deploy the app then the URL should match that of your
>> application.
>>
>>
>> Josh Juneau
>> juneau001@gmail.com
>> http://jj-blogger.blogspot.com
>> Twitter ID:  javajuneau
>>
>>
>> On Sat, Aug 1, 2009 at 10:28 AM, Josh Juneau <juneau001@gmail.com> wrote:
>>
>>> Hi Cliff-
>>> The Google App Engine is a bit weird with the PyServlet as it does not
>>> want to handle the .py file as code, but rather as text like you had
>>> mentioned.  You should add your .py code to the appengine-web.xml file
>>> as
>>> "static files" and then set up the PyServlet in your web.xml as usual
>>> (mapped to url-pattern of *.py).
>>>
>>> Suppose my Jython servlet name is NewJythonServlet.py and the path on my
>>> OS to the file is /Jython-code/servlets/NewJythonServlet.py, I will need
>>> to
>>> set up my appengine-web.xml as follows:
>>>
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
>>>     <application>MyJythonApp</application>
>>>     <version>1</version>
>>>     <static-files>
>>>         <include path="/Jython-code/servlets/NewJythonServlet.py"/>
>>>     </static-files>
>>>     <sessions-enabled>true</sessions-enabled>
>>> </appengine-web-app>
>>>
>>> Once this is completed, you can deploy to GAE and run as follows
>>> http://gae-server:8080/NewJythonServlet.py
>>>
>>> Let me know if this works out for you.
>>>
>>> Josh Juneau
>>> juneau001@gmail.com
>>> http://jj-blogger.blogspot.com
>>> Twitter ID:  javajuneau
>>>
>>>
>>> On Sat, Aug 1, 2009 at 7:11 AM, Cliff Hill <xlorep@darkhelm.org> wrote:
>>>
>>>> Is there anyone here who has successfully gotten Jython 2.5.0 to work
>>>> with GAE? I was able to make modjy work with it, but I would rather not
>>>> use
>>>> modjy. I'm building a small site from scratch, and want to use
>>>> PyServlet,
>>>> but I am running into a snag -- after I set everything up, instead of
>>>> processing my python code, the server is simply giving me my .py file
>>>> to
>>>> download.
>>>>
>>>> I can get more specifics if needed.
>>>>
>>>> --
>>>> "I'm not responcabel fer my computer's spleling errnors" - Xlorep
>>>> DarkHelm
>>>> Website: http://darkhelm.org
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Let Crystal Reports handle the reporting - Free Crystal Reports 2008
>>>> 30-Day
>>>> trial. Simplify your report design, integration and deployment - and
>>>> focus on
>>>> what you do best, core application coding. Discover what's new with
>>>> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
>>>> _______________________________________________
>>>> Jython-users mailing list
>>>> Jython-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/jython-users
>>>>
>>>>
>>>
>>
>
>
> --
> "I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
> Website: http://darkhelm.org
> Sent from Santa Maria, California, United States
>

--
Sent from my mobile device

Josh Juneau
juneau001@gmail.com
http://jj-blogger.blogspot.com
Twitter ID:  javajuneau



--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States



--
"I'm not responcabel fer my computer's spleling errnors" - Xlorep DarkHelm
Website: http://darkhelm.org
Sent from Santa Maria, California, United States