Here's my naif setup - note that this should be exactly the same for Eclipse or Aptana (Aptana is Eclipse + goodies):
1. Use web2py source.
2. Make sure you have PyDev installed in Eclipse/Aptana.
3. Create a project a PyDev project:
* this will link to the web2py folder on the file system - so you will have access to all projects and the web2py installation
* I call this project "web2py_projects"
* (if you know what a perspective is in Eclipse, you can use either Aptana or PyDev perspectives - it's irrelevant).
4. Create a link to the web2py folder in the project: just create a folder and use the "Advanced >>" button to link to the web2py folder in the file system
Know you are ready to go!
In general I either duplicate an existing project directly from the file view in the IDE or I use the web2py web interface to do it.
Note that if you change any web2py files from outside of Eclipse, then you will have to refresh the project so that the file structure is re-read. This can be done by selecting the project in the File View and pressing F5.
Debugging with PyDev:
Since we are in development I always run web2py in PyDev's debugging mode
1. Run we2py regularly, set an admin password and stop the server. This is just so you have a password set in web2py for admin access
2. Open the web2py.py file
3. Select Debug | Debug configurations - under "Python Run" create a new configuration, name it: "Run web2py" (or something useful):
* In the Main tab: select the web2py_projects as the "Project" and select the web2py.py file as the "Main Module"
* Click "Apply"
* In the "Arguments" tab type (without the curly braces): {-p 8080 -a "<recycle>"} this will avoid the dialog for starting web2py and will run on port 8080 with the last password used (you must have set an admin password previously)
* Some of the other tabs may be useful, e.g. setting the interpreter
4. When ready click "Debug", and presto web2py is running in PyDev's debug mode
5. When you wish to debug some code just double click, or "right-click" on the code editors left margin to set break points. PyDev will automatically launch the debug perspective.
BTW If you search you can find some info on getting code completion to work (I have not yet bothered).
HTH,
Miguel