python - 所有错误都会导致 URLconf 循环导入
问题描述
我的 django 应用程序中的任何错误都会导致:
The included URLconf 'appname.urls' does not appear to have any
patterns in it. If you see valid patterns in the file then the issue
is probably caused by a circular import.
在 pdb 中逐步执行时,我意识到我的应用程序中发生的任何错误都会导致 URLconf 错误。pdb 将显示实际发生的错误,但如果我继续,控制台将仅打印上面显示的 URLconf 错误。如果我去修复 pdb 显示的错误,例如我解决的 SyntaxError,那么一切正常。似乎任何错误我只是导致上面显示的 URLconf 错误,我不确定如何解决它,以便我可以在不通过 pdb 的情况下看到实际错误。
更新:我使用的是 Python 3.5.2,升级到最新的 Python 3.6.9 已修复该错误。
解决方案
我使用的是 Python 3.5.2,经过更多搜索后,它看起来像是一个 Python 问题。升级到 Python 3.6.9 解决了这个问题。
推荐阅读
- swift - Flutter 没有构建 iOS 应用程序,这是一个快速的错误吗?
- javascript - 在正则表达式中接受字母数字字符、空格、点和破折号 [JavaScript]
- magento-1.9 - 默认商店视图打开不同商店的商店视图
- ruby-on-rails - 如何从应用程序本身调用 Rails 生成器?
- sql - SQL 存储视图快照和更改
- javascript - JS 是否会与有关“typeof null”的 ECMAScript 规范保持一致?
- c++ - 从特定程序中捕获音频
- vb.net - 确定目录名称路径
- powershell - Env: 和 [System.Environment] 有什么区别?
- c# - PreviewMouseDown 路由到边框/文本块而不是按钮