views:

1069

answers:

4

I am trying to get pylons to debug in Eclipse under Ubuntu. Specifically. I am not sure what to use for the 'Main Module' on the Run configurations dialog.

(this is a similar question on stackoverflow, but I think it applies to windows as I can't find paster-script.py on my system)

Can anyone help?

+3  A: 

I've managed to fix this now.

In Window>Preferences>Pydev>Interpreter-Python remove the python interpreter and reload it (select New) after installing pylons.

In the Terminal cd into the projects directory. Then type sudo python setup.py develop Not sure what this does, but it does the trick (if any one wants to fill me in, please do)

In Run>Open Debug Dialog enter the location of paster in Main Module. For me this is /usr/bin/paster . Then in the Arguments tab in Program arguments enter serve /locationOfYourProject/development.ini

All set to go. It took a lot of search for me to find out that it does not work if the arguments includes --reload

SystemicPlural
+1  A: 

I got it running basically almost the same way - although you do not have to do the setup.py develop step - it works fine without that.

What it does is that is sets global link to your project directory for a python package named after your project name.

Bartosz Radaczyński
+1  A: 

I do need this step "sudo python setup.py develop" to get it running.. otherwise it throw out some exceptions.

btw, the setup.py is the one in your created project.

A: 

Haven't tried on Eclipse, but I bet the solution I have been using to debug Pylons apps in WingIDE will work here too.

  1. Write the following two-liner (name it run_me.py or similarly) and save it in your project directory:

    from paste.script.serve import ServeCommand

    ServeCommand("serve").run(["development.ini"])

  2. Set this file as main debug target (aka main module)

  3. Enjoy.