Version 44 (modified by Pat Tressel, 13 years ago) ( diff )


Developer Guidelines - Eclipse

Eclipse is a full IDE supporting Debugging & Code Completion.

PyDev is an Eclipse module which supports Python.


An Eclipse install with PyDev included is available in the 75Mb zip file which also includes Web2Py & Eden:

or install manually:

  1. Install Java JDK
  2. Install Eclipse (setup for 3.6 is documented below):
    • Look for "Latest release" on the downloads page.
    • (For Linux, and also apt-get install eclipse-platform but may get old version.)
  3. If using JDK 6u21: modify eclipse.ini
  4. Install PyDev through Eclipse:
    1. Help menu > Install New Software
    2. Work with:
    3. Add, OK
    4. tick PyDev (can exclude the optional PyDev Mylyn Integration), Next, Next, Accept, Finish
    5. tick to trust certificate, Restart now
  5. Recommend installing Psyco to speed-up Python in Eclipse:


  1. Set up the Python Interpreter:
    1. Window > Preferences > PyDev > Interpreter - Python
    2. New, Browse to python26/python.exe (or python27/python.exe if using 2.7), OK, OK
  2. Add a new PyDev Project:
    1. File > New > Project > PyDev Project > Next
    2. untick Use Default
    3. Browse to the web2py directory
    4. Give the project a name, e.g.: "web2py", Next
    5. untick "Create default 'src' folder and add it to the pythonpath"
  3. Debug Configuration: Run > Debug Configurations > Python Run
    1. Name: Enter a name, e.g. web2py or eden.
    2. Project: Browse to web2py
    3. Main Module: Browse to
    4. Arguments tab: Program Arguments: -a password (Choose a password for web2py and substitute it for "password".)
    5. Apply, Debug
    6. If asked, unblock in Windows Firewall
  4. If you want a HTML and JS editor (with syntax highlighting) in Eclipse:
    1. Help menu > Install New Software
    2. Work with:
    3. Add, OK
    4. Select Web, XML and Java EE Development
    5. (If present) select Web Tool Platform
    6. (If you get a conflicting dependency error, deselect the problem tool.)
    7. Tick to trust certificate, Restart now
  1. Miscellaneous suggestions:
    1. Right-click on Java perspective in top-right & select Close
    2. Window > Open Perspective > Other > Debug
    3. Window > Show View > Expressions
    4. Right-click on toolbar > Customise Perspective > Go through the tabs and untick PyDev Debug, Run, and External Tools
    5. Window > Preferences > General > Editors > File Associations > *.html
      • If Text Editor is not in the list of associated editors: Add (lower one), Text Editor, OK.
      • Select Text Editor, click default, OK.
      • Select Web Page Editor, remove, OK.
      • Select Web Browser, remove, OK.
    6. Window > Preferences > General > Editors > Text Editors
      • tick Show line numbers
      • tick Show Print Margin and set the margin to 80 (to assist in our vain attempt to keep within that width)
    7. Window > Preferences > General > Workspace
      • tick 'Refresh on access'
      • untick 'Build automatically'
    8. You may want to change the layout of the window by dragging sections to convenient regions of the window and resizing them. Combine less-used sections as tabs in the same region.

Debugging with Eclipse

  • Set and remove breakpoints by double clicking in the margin of the code file
  • Click the 'Debug Sahana Eden' button
  • F5 Step into functions
  • F6 Step over lines
  • F7 Step out of functions
  • Use expressions (drag and drop from code) or right-click > watch

Accessing private data

Some data is marked as private to let other developers know they shouldn't access this directly

  • e.g. in we have S3Resource.__set & S3Resource.__query

This then means that Eclipse can't see these attributes as self.__set, etc.

Instead need to use:




Bzr integration (optional)

Other Configuration Guides (should not be required):


Note: See TracWiki for help on using the wiki.