Search code examples
pythondjangoeclipsedebuggingpydev

Liclipse/Eclipse: setup debugging environment for a django project alongwith its virtualenv


I am looking for a clearly written set of steps to import an existing django project stored in a GIT repository into Liclipse (Eclipse configured for python) configured using virtualenv and running successfully.

I used File->Import to import an existing project from its top level directory /home/comiventor/ProjectXYZ/ containing .git

Now when I run ProjectXYZ->Django-> Sync DB (manage.py syncdb)

It says "pydev nature is not properly set"

I could not derive much help on this error from any other source. :(

[Update]

I am able to run the django server from eclipse (steps in my answer below) but still not able to make the code stop at breakpoint. :(


Solution

  • [Update] The error got resolved after setting python environment via

    • Right Click on Project in Project Explorer -> PyDev -> Source PyDev Project Config
    • Project Explorer -> Properties -> PyDev Interpreter
    • Project Explorer -> Properties -> PyDev PYTHONPATH
    • add exact path within virtualenv where the python site-packages are installed

    After this, one also needs to fill two fields in PyDev - Django

    • Django manage.py = your manage.py file
    • Django settings module = settings.local or whichever is your settings file

    Hope it helps.

    I am able to run the django server from eclipse but still not able to make the code stop at breakpoint. :(