Reputation: 42730
Previously, I have a Google App Engine application (jstock-static), which is only used to host some static files so far. Inside folder WEB-INF, here are the content
war/WEB-INF/web.xml
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app xmlns="http://java.sun.com/xml/ns/javaee" version="2.5">
</web-app>
war/WEB-INF/appengine-web.xml*
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>jstock-static</application>
<version>1</version>
</appengine-web-app>
Now, I would like to host some python scripts. Instead of creating another application, I decide to make the scripts re-inside jstock-static application.
I add 2 new files to see whether it works. (They are highlighted in red)
Here is the content of newly added files.
war/app.yaml
application: jstock-static
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: helloworld.py
I then try to upload it to app engine server using the following command.
C:\Projects\jstock-static\war>c:\appengine-java-sdk-1.3.2\bin\appcfg.cmd update .
However, when I make a request through web browser using http://jstock-static.appspot.com/helloworld.py, the script is not being executed. Instead, the entire python script was being downloaded.
May I know is there anything I had missed out?
Upvotes: 0
Views: 297
Reputation: 89937
You can't execute Python code from an application running on the Java runtime (unless you use Jython). Python applications don't go inside a war, and need to be deployed using the appcfg.py script in the Python SDK.
Upvotes: 3