Google App Engine
zoqui
10:19 pm
Walk-Through
Installing the PyDev plug-in:
- Click on menu items:
Help > Software Updates > Available Software (tab) > Add Site
- Type:
http://pydev.sourceforge.net/updates/
- Click on [OK button]
- Check the PyDev For Eclipse option:
- + http://pydev.sourceforge.net/updates/
- – + Pydev
- – - + [X] PyDev For Eclipse
- Click on [Install button] and Wait
- Click on [Next button]
- Click on “I accept the terms of the license agreement” option
- Click on [Finish button] and wait
- Click on [YES button] to restart Eclipse
Configuring the python interpreter:
- Click on menu items:
Window > Preferences
- Open the nodes:
- + Pydev
- – + Interpreter – Python
- Click on [New button]
- Browse the python.exe application
Windows default: C:\Python25\python.exe
Linux default: /opt/bin/python2.5
- Click on [OK button] to add the suggested folders to the pythonpath
- Click on [Ok Button] to confirm
Creating a GoogleApp project:
- Right-Click on Project Explorer
- Choose:
New > Other
- Select “PyDev Project” option:
- + Pydev
– - + Pydev Project
- Click on [Next button]
- Type the project name:
helloworld
- Select the python 2.5 as target project type
- Click on [Finish button]
- adding the GoogleApp Engine libraries
- In the PyDev Package Explorer panel
- Right Click on your new project
- Select the Properties option
- Select the PyDev – PYTHONPATH item
- Click on [Add source folder button] of the External Source Folders panel
- Add each of the following folders:
Windows default:
- C:\Program Files\Google\google_appengine\lib\django
- C:\Program Files\Google\google_appengine\lib\webob
- C:\Program Files\Google\google_appengine\lib\yaml
- C:\Program Files\Google\google_appengine\lib\
- C:\Program Files\Google\google_appengine\
- Click on [OK button] to confirm
Editing the application sources
- In the PyDev Package Explorer panel
- Right Click on your project
- Select:
new > file option
- In the File name edit box type:
app.yaml
- Click on [Finish button]
- In the source editor type the following text:
application: helloworld
version: 1
runtime: python
api_version: 1
handlers:
- url: /.*
script: helloworld.py
- In the PyDev Package Explorer panel
- Right Click on your project
- Select
new > file option
- In the File name edit box type:
helloworld.py
- Click on [Finish button]
- In the source editor type the following text:
print 'Content-Type: text/plain'
print ''
print 'Hello, world!'
Running the Application
- Click on
Run > Run Configurations
- in the Main Tab:
- Select Python Run option and name your new configuration:
type hello
- Click the Project [Browse button]
- Select the helloworld project and click [OK button]
- On the Main Module text box type:
C:\Program Files\Google\google_appengine\dev_appserver.py
- In the Arguments Tab:
- Type the following code into the Program Arguments:
“${project_loc}”note: any supported dev_appserver.py argument line can be entered. You may for instance type:
“${project_loc}”
–port=9999
- Click on [Apply button]
- Click on [Run button]
References
Trackback URI
Leave a Reply