简体   繁体   English

Django-找不到要重新加载的源

[英]Django - Could not find source to reload

I'm currently using LiClipe with PyDev to debug my project. 我目前正在将LiClipePyDev 配合使用来调试我的项目。

I have a separate module which sits in the core directory of my Django project. 我有一个单独的模块,位于我的Django项目的核心目录中。

While the project is running in Debug mode I'm able to edit code, save it and then get a confirmation that it is working in the console. 当项目以Debug模式运行时,我可以编辑代码,将其保存,然后确认其是否在控制台中运行。

However when I edit this particular module I get the following issue which I'm not sure how to approach: 但是,当我编辑此特定模块时,出现以下问题,我不确定该如何处理:

pydev debugger: Start reloading module: "pspotter" ... 
pydev debugger: Could not find source to reload (mod: pspotter)
pydev debugger: reload finished

Furthermore the code doesn't seem to be running as it's using apscheduler . 此外,由于使用apscheduler ,因此代码似乎未在运行。

Am I meant to reference this file from somewhere else? 我是否打算从其他地方引用此文件?

In the latest version, when you're running under the debugger, PyDev will try to make a reload on the existing process. 在最新版本中,当您在调试器下运行时,PyDev将尝试在现有进程上进行重新加载。 In this particular case it can't find the module to reload in sys.modules and it's just warning you that the reload failed (so, it's just signalling that you have to restart the debug session in order to get those changes as it wasn't able to do a 'hot' reload). 在这种特殊情况下,它无法在sys.modules中找到要重新加载的模块,而只是警告您重新加载失败(因此,它只是表示您必须重新启动调试会话才能获得这些更改,因为它实际上不是'无法进行“热”重装)。

If you don't want to use that feature, you can disable it in the preferences > pydev > debug > 'when file is changed automatically reload'. 如果您不想使用该功能,可以在首选项> pydev>调试>“当文件被自动更改时重新加载”将其禁用。

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

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