简体   繁体   English

Liclipse / Eclipse:为Django项目及其virtualenv设置调试环境

[英]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. 我正在寻找一组明确编写的步骤,以将存储在GIT存储库中的现有django项目导入使用virtualenv配置并成功运行的Liclipse(为python配置的Eclipse)中。

I used File->Import to import an existing project from its top level directory /home/comiventor/ProjectXYZ/ containing .git 我使用File-> Import从其顶级目录/ home / comiventor / ProjectXYZ /包含.git导入现有项目

Now when I run ProjectXYZ->Django-> Sync DB (manage.py syncdb) 现在当我运行ProjectXYZ-> Django-> Sync DB(manage.py syncdb)

It says "pydev nature is not properly set" 它说“ pydev性质设置不正确”

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. 我能够从eclipse运行django服务器(下面我的回答中的步骤), 但仍然无法使代码在断点处停止。 :( :(

[Update] The error got resolved after setting python environment via [更新]通过设置python环境后,错误得到解决

  • Right Click on Project in Project Explorer -> PyDev -> Source PyDev Project Config 右键单击Project Explorer中的Project-> PyDev-> Source PyDev Project Config
  • Project Explorer -> Properties -> PyDev Interpreter 项目浏览器->属性-> PyDev解释器
  • Project Explorer -> Properties -> PyDev PYTHONPATH 项目浏览器->属性-> PyDev PYTHONPATH
  • add exact path within virtualenv where the python site-packages are installed 在virtualenv中添加安装python站点软件包的确切路径

After this, one also needs to fill two fields in PyDev - Django 之后,还需要在PyDev中填写两个字段-Django

  • Django manage.py = your manage.py file Django manage.py =您的manage.py文件
  • Django settings module = settings.local or whichever is your settings file Django设置模块= settings.local或您的设置文件中的任何一个

Hope it helps. 希望能帮助到你。

I am able to run the django server from eclipse but still not able to make the code stop at breakpoint. 我可以从eclipse运行django服务器,但仍然无法使代码在断点处停止。 :( :(

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM