Pycharm 无法解析 django 网址

amp*_*led 5 python django pycharm

我正在运行 Pycharm 2016.1 并使用 Django 1.8 处理一个项目。通常 PyCharm 有这个简洁的功能,可以{% url %}在模板中为你自动完成标签,但是检查对我来说已经失败了一段时间,甚至根本不会发现 url,给我这个错误:

未解析的网址

该项目运行良好,Django 在运行时发现了所有 url,所以问题应该出在 PyCharm 上。

Rob*_*ber 3

This was also driving me nuts. The only thing that worked for me was to delete two things (after closing Pycharm).

  1. Delete the entire .idea folder within the project directory.
  2. Delete the pycache directory within the project directory (if exists)

I re-opened the project and every reference issue I had went away.

Hope this helps!

NOTE: I had previously tried:

  • Restarting Pycharm
  • Invalidating Caches
  • 调整项目首选项并修改 Django 设置以及禁用然后重新启用 Django 支持
  • 调整命名空间、settings.py 文件等。