How to use Eclipse + PyDev with TG2

222 views
Skip to first unread message

Kees van den Broek

unread,
Sep 7, 2009, 12:15:05 PM9/7/09
to TurboGears
Hi,

The recent open sourcing of the proprietary parts from the PyDev
Eclipse plugin triggered a renewed interest in the plugin.
I tried debugging a TG2 app with it. But I can't get it to properly
start "paster serve development.ini" and attach a debugger.
The site lists a tutorial for TG1 (dating from 2006) and notes several
issues (that are probably no longer relavant): http://pydev.org/manual_101_root.html
I'd like to hear from anyone succesfully using PyDev.
I'd even volunteer to write a tutorial once I get the beast
started ;-)

Cheers,
Kees

KMCB

unread,
Sep 7, 2009, 7:33:50 PM9/7/09
to TurboGears
Kees,

I may be able to help. It has been some time, since I did this.

KMCB

For TG2, provided pydev is setup.

1) Under Run->External Tool->External Tools Configurations
2) Create a "New Launch Configuration"
3) On the Main Tab
Name: TG2 App Start
Location: /usr/local/devenv/tg2env/bin/paster (Your Path to
paster)
Working Directory: ${project_loc}
Arguments: serve --reload development.ini
4) On the Common Tab
Check "Display in favorites menu" > External Tools
5) Apply and close
6) In Navigator Window, highlight the project folder.
7) Under Run->External Tool->External You can select the new "TG2 App
Start"

Kees van den Broek

unread,
Sep 8, 2009, 3:05:38 AM9/8/09
to TurboGears
Hi KMCB,

Thanks for your suggestions, it launches the app correctly.
The solution I was ideally looking for not only starts the app, but
also gives me the ability to set breakpoints and really debug the app.
Do you have any suggestions for this case too?

Cheers,
Kees

KMCB

unread,
Sep 8, 2009, 12:44:05 PM9/8/09
to TurboGears
Kees,

This may get you closer. It looks like there is a conflict between
DecoratorTools and Pydev.


In your main project folder, create launch_tg.py and add these two
lines.

from paste.script.serve import ServeCommand
ServeCommand("serve").run(["development.ini"])

Now run this to start it.

Regards,
KMCB

http://rowsandcolumns.blogspot.com/2009/06/turbogears-debugging-in-eclipse.html
http://pydev.blogspot.com/2007/06/why-cant-pydev-debugger-work-with.html

Kees van den Broek

unread,
Sep 8, 2009, 6:20:57 PM9/8/09
to TurboGears
> This may get you closer.  It looks like there is a conflict between
> DecoratorTools and Pydev.

Yes, that was an issue with TG1, doesn't seem to be a problem now.

> from paste.script.serve import ServeCommand
> ServeCommand("serve").run(["development.ini"])

Those 2 lines were all that was needed. That's great news!

Cooking a tutorial right now:
http://kvdb.net/blog/turbogears-2-eclipse-pydev/

Cheers,
Kees
Reply all
Reply to author
Forward
0 new messages