Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pycharm failing to resolve django urls

Tags:

I'm running Pycharm 2016.1 and working on a project with Django 1.8. Usually PyCharm has this neat feature that can autocomplete {% url %} tags for you in templates, however the inspection has been failing for me for a while now and won't even discover the urls at all, giving me this error:

unresolved url

The project works fine and Django discovers all the urls when running, so the problem should be with PyCharm.

like image 725
ampled Avatar asked Apr 27 '16 07:04

ampled


1 Answers

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
  • Adjusting project preferences and tinkered with Django settings as well as disabling then re-enabling Django support
  • Adjusting namespaces, settings.py file etc..
like image 181
Rob Barber Avatar answered Sep 28 '22 04:09

Rob Barber