Walk-Through

Installing the PyDev plug-in:

  1. Click on menu items:
    Help > Software Updates > Available Software
    (tab) > Add Site
  2. Type:
    http://pydev.sourceforge.net/updates/
  3. Click on [OK button]
  4. Check the PyDev For Eclipse option:
    - + http://pydev.sourceforge.net/updates/
    - – + Pydev

    - – - + [X] PyDev For Eclipse

  5. Click on [Install button] and Wait
  6. Click on [Next button]
  7. Click on “I accept the terms of the license agreement” option
  8. Click on [Finish button] and wait
  9. Click on [YES button] to restart Eclipse

Configuring the python interpreter:

  1. Click on menu items:
    Window > Preferences
  2. Open the nodes:
    - + Pydev
    - – + Interpreter – Python
  3. Click on [New button]
  4. Browse the python.exe application
    Windows default: C:\Python25\python.exe
    Linux default: /opt/bin/python2.5

  5. Click on [OK button] to add the suggested folders to the pythonpath
  6. Click on [Ok Button] to confirm

Creating a GoogleApp project:

  1. Right-Click on Project Explorer
  2. Choose:
    New > Other
  3. Select “PyDev Project” option:
    - + Pydev
    – - + Pydev Project
  4. Click on [Next button]
  5. Type the project name:
    helloworld
  6. Select the python 2.5 as target project type
  7. Click on [Finish button]
  8. adding the GoogleApp Engine libraries
    1. In the PyDev Package Explorer panel
    2. Right Click on your new project
    3. Select the Properties option
    4. Select the PyDev – PYTHONPATH item
    5. Click on [Add source folder button] of the External Source Folders panel
    6. Add each of the following folders:
      Windows default:

      1. C:\Program Files\Google\google_appengine\lib\django
      2. C:\Program Files\Google\google_appengine\lib\webob
      3. C:\Program Files\Google\google_appengine\lib\yaml
      4. C:\Program Files\Google\google_appengine\lib\
      5. C:\Program Files\Google\google_appengine\
    7. Click on [OK button] to confirm

Editing the application sources

  1. In the PyDev Package Explorer panel
  2. Right Click on your project
  3. Select:
    new > file option
  4. In the File name edit box type:
    app.yaml
  5. Click on [Finish button]
  6. In the source editor type the following text:
    application: helloworld
    version: 1
    runtime: python
    api_version: 1
    
    handlers:
    - url: /.*
      script: helloworld.py
  7. In the PyDev Package Explorer panel
  8. Right Click on your project
  9. Select
    new > file option
  10. In the File name edit box type:
    helloworld.py
  11. Click on [Finish button]
  12. In the source editor type the following text:
    print 'Content-Type: text/plain'
    print ''
    print 'Hello, world!'

Running the Application

  1. Click on
    Run > Run Configurations
  2. in the Main Tab:
    1. Select Python Run option and name your new configuration:
      type hello
    2. Click the Project [Browse button]
    3. Select the helloworld project and click [OK button]
    4. On the Main Module text box type:
      C:\Program Files\Google\google_appengine\dev_appserver.py
  3. In the Arguments Tab:
    1. 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
    2. Click on [Apply button]
      1. Click on [Run button]

References