Tuesday, May 25, 2010

Setting up Pydev in Eclipse for Django development with Python

While researching ways to do Python/Django development using Eclipse, I found this wonderful, though slightly outdated, tutorial video by Nick Vlku that streamlines the process quite well:

As I mentioned, the video is slightly outdated, but very well made. Here are the things that have changed or that I would suggest doing differently than the video:

As I use Ubuntu 10.04, I would suggest installing these packages from the Ubuntu repositories: eclipse-jdt, and eclipse-pde. Without eclipse-pde, you can't install extensions (such as Pydev). You could also simply search for "Eclipse" in the Ubuntu Software Center.

Pydev and the Pydev Extensions have now been merged together as of version 1.5.0, so you now have all of the extra capabilities from Pydev Extensions in the open source Pydev package. Pydev also has a new website- http://pydev.org/.

To add PyDev to Eclipse, Go to Help --> Install New Software.
Then Click on Add in the upper right hand corner and enter PyDev for the name, and http://pydev.org/updates for the location.
Select PyDev for Eclipse, select "Next", agree to terms, and the "Finish".

For Django, To add the Start and Stop Debug server buttons, after right-clicking the Icon bar and choosing "Customize Perspective:, the PyDev Debugger Server buttons were under "Command Groups Availability" -- not "Commands".

You should now have a working PyDev development perspective in Eclipse, including integration with Django. Enjoy!