Wednesday, June 13, 2012

Setting up Eclipse Debug configs to work with Django


  • Eclipse > File > Import > General > Existing projects into workspace > Next > 
  • For 'Select root directory:' browse to the app folder. [the one with manage.py] and hit Finish.
  • We now need to install PyDev,
    Help > Install New Software > Add...
    Name: Pydev    Location: http://pydev.org/updates  >> OK
    Select only PyDev and not PyDev Mylyn... >> Next > Next > I accept > Finish > Trust all certificates > Restart Eclipse when prompted.
  • Eclipse > Debug Configurations > Python run.
  • Right click on Python Run > New.
  • Click the New_configuration which is newly created in the left pane.
  • For Project, Browse to the 'app' folder. [the one with manage.py]
  • For Main Module, Browse to the 'manage.py' inside the above app folder.
  • Then click the Arguments tab at the top.
    Add 'runserver 8000 --noreload' (without quotes) into Program arguments.
  • Hit Apply. You're done.


NOTE: You may also have to select the appropriate Interpreter after selecting Arguments. Use /path/to/venv/projectname/bin/python if inside a venv else use usr/src/bin/python2.7

No comments:

Post a Comment

Popular Posts