Friday, March 14, 2008

Eclipse Django Debugging

In order to debug, the preferred way for me, is to do it through the Eclipse with PyDev configured for Django. To do this, we need a couple more of adjustments in order to get the django runserver running properly.

We go the main menu and we select the Open Run Dialogue... window, there we select on the left Python Run and on the Main tab to the right we select the project where we are going to make the debugging: /some/path/to/sources/

In the Arguments tab we add the Program Arguments: runserver --noreload and then we finally select the Environment tab where we add the
DJANGO_SETTINGS_MODULE set to value settings and PYTHONPATH set to value $PWD. Click Apply and Run.

If you look at the console view, you will see the runserver output which indicates that all is well:

Validating models...
0 errors found

Django version 0.97-pre-SVN-unknown, using settings 'txm.settings'
Development server is running at
Quit the server with CONTROL-C.

The catch here, is that in order to have the server pick up the changes we make, we will need to stop it an rerun it every time.

So far so good, till next time.


Leonardo Fernandes said...

Thanks man.
Helps us a lot.
Using pdb is good, but sometimes I prefeer to use this way.

Clear Cost said...

Thanks a lot!
Nice job! :)

colin tylk said...

What a shitty tutorial. I want my 5 minutes back...

Blackhood said...

9 years and this is still working!!