2

I've opened my Django project in PyCharm, as I want to use a proper IDE instead of a text editor to better manage the project.

When I run Find Usages on a function in /projectroot/app/views.py it says "No usages found in Project Files," but when I run CMD + SHIFT + F it finds 34 matches in 13 files.

As suggested in this answer, I

  1. marked /projectroot/ directory as Sources Root
  2. did File > Invalidate Caches / Restart...
  3. in Find Options... I also tried to searching in All Places

If I run Find Usages on some other functions in /projectroot/app/helpers.py it seems to work.

Any ideas what else I could try?

enter image description here

M3RS
  • 6,720
  • 6
  • 37
  • 47
  • 1
    Usages in PyCharm are - if i recall correctly - detected through imports, etc. But that does not mean it can not be imported for example through a string, etc. This is a consequence of the "hyperdynamic" nature of Python: it is impossible to determine *all* possible scenario's of usage. – Willem Van Onsem Aug 24 '18 at 14:30
  • Thanks, this helped a lot! I started to look through the imports and realised that when the function was used it was imported from somewhere else. – M3RS Aug 24 '18 at 14:38

0 Answers0