1

I have set up Eclipse (Windows XP) with pydev in order to run and debug a django web app project I have. I also have this projcet under subversion control. At the moment I have a working copy of the trunk operating within Eclipse (with full debugging capability). I always run into problems when I check out a branch of this code and run it in a sperate eclipse pydev project. I have the PYTHON interpreter set to the right manage.py and work locations, but when I run/debug this branch code it always appears to be running the code that is resident in the truck project. I've tried restarting Eclipse/My computer but to no avail. This should work as I have had both working separately in the past, but can't figure out what I have forgotten to do. Any ideas?

Thanks, G

GDjango
  • 11
  • 1
  • Have you tried closing the trunk project or using different workspaces for the trunk and branch? – Velociraptors Dec 09 '10 at 15:58
  • Hi Vel, If by 'closing' the trunk you mean stop the debug server on it then yes. I haven't tried separating them out to different workspaces as I know this has worke in the past, and was hoping to avoid setting up a new workspace (maybe I'm wrong in assuming I'd have to resteup everything, pydev etc, up again in that new workspace?) – GDjango Dec 09 '10 at 16:04
  • just further detail to add - if I right click on the manage.py file and hit the debug from there it appears to go off and read the settings.py from the other project. I know I'm probably doing something daft here, but I can't work out what that is. – GDjango Dec 09 '10 at 16:06

1 Answers1

0

I'm using Python 2.7 + PyDev + Aptana on Windows 7 64-bit.

I created a separate branch for my project in svn, and imported that branch as a new project. From there, I created a debug configuration (Run > Debug Configurations).

Under the Python Run section I created a "My Test Branch" debug configuration setting manage.py as the main module and passing in: runserver 8000 --noreload as the program arguments.

When I imported the project, I purposefully named the project folder differently so any module imports referencing the folder in my Django app would fail. This is a bullet-proof way to make sure the debug is using the right settings and reading from the correct files. Example:

My trunk project folder name is: "my_website" My branch project folder name is: "my_branch_website"

So, an import like:

from my_website.models import MyModel

would fail when debugging the branch.

When I run the debug configuration, and load: http://localhost:8000/ I got the expected result - the imports fail and the project won't run.

So, I checked out that branch into a separate folder from where the trunk is checked out so I can name the checkout folder the same as trunk, ran the debug configuration, and it loads the correct settings.

Brandon Taylor
  • 33,823
  • 15
  • 104
  • 144