Django-Pydev-Eclipse 和多项目问题
我已经使用 pydev 设置了 Eclipse (Windows XP),以便运行和调试我拥有的 django Web 应用程序项目。我也有这个项目处于颠覆控制之下。目前我有一个在 Eclipse 中运行的 trunk 的工作副本(具有完整的调试功能)。当我签出此代码的分支并在单独的 eclipse pydev 项目中运行它时,我总是遇到问题。我将 PYTHON 解释器设置为正确的 manage.py 和工作位置,但是当我运行/调试此分支代码时,它似乎总是运行卡车项目中驻留的代码。我尝试重新启动 Eclipse/我的电脑,但没有成功。这应该有效,因为我过去曾分别工作过,但不知道我忘记做什么。有什么想法吗?
谢谢, G
I have set up Eclipse (Windows XP) with pydev in order to run and debug a django web app project I have. I also have this projcet under subversion control. At the moment I have a working copy of the trunk operating within Eclipse (with full debugging capability). I always run into problems when I check out a branch of this code and run it in a sperate eclipse pydev project. I have the PYTHON interpreter set to the right manage.py and work locations, but when I run/debug this branch code it always appears to be running the code that is resident in the truck project. I've tried restarting Eclipse/My computer but to no avail. This should work as I have had both working separately in the past, but can't figure out what I have forgotten to do. Any ideas?
Thanks,
G
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在 Windows 7 64 位上使用 Python 2.7 + PyDev + Aptana。
我在 svn 中为我的项目创建了一个单独的分支,并将该分支作为新项目导入。从那里,我创建了一个调试配置(“运行”>“调试配置”)。
在 Python Run 部分下,我创建了一个“My Test Branch”调试配置,设置 manage.py 作为主模块,并传入: runserver 8000 --noreload 作为程序参数。
当我导入项目时,我故意以不同的方式命名项目文件夹,因此引用 Django 应用程序中的文件夹的任何模块导入都会失败。这是确保调试使用正确设置并读取正确文件的万无一失的方法。示例:
我的主干项目文件夹名称是:“my_website”
我的分支项目文件夹名称是:“my_branch_website”
像这样的导入:
from my_website.models import MyModel
因此,在调试分支时,
将失败。当我运行调试配置并加载: http://localhost:8000/ 我得到了预期的结果 - 导入失败并且项目将无法运行。
因此,我将该分支检出到检出主干的单独文件夹中,以便我可以将检出文件夹命名为与主干相同的名称,运行调试配置,并加载正确的设置。
I'm using Python 2.7 + PyDev + Aptana on Windows 7 64-bit.
I created a separate branch for my project in svn, and imported that branch as a new project. From there, I created a debug configuration (Run > Debug Configurations).
Under the Python Run section I created a "My Test Branch" debug configuration setting manage.py as the main module and passing in: runserver 8000 --noreload as the program arguments.
When I imported the project, I purposefully named the project folder differently so any module imports referencing the folder in my Django app would fail. This is a bullet-proof way to make sure the debug is using the right settings and reading from the correct files. Example:
My trunk project folder name is: "my_website"
My branch project folder name is: "my_branch_website"
So, an import like:
from my_website.models import MyModel
would fail when debugging the branch.
When I run the debug configuration, and load: http://localhost:8000/ I got the expected result - the imports fail and the project won't run.
So, I checked out that branch into a separate folder from where the trunk is checked out so I can name the checkout folder the same as trunk, ran the debug configuration, and it loads the correct settings.