Pycharm (Python IDE) doesn't auto complete Django modules
I had exactly the same issue and couldn't find a definitive answer. Just invalidating caches didn't work for me. The problem lies in the fact that, at some point, __init__.py
files got registered as text files and messed up the indexing. I worked out this fix:
- Preferences > File Types > Text Files.
- Remove
__init__.py
from the list of registered patterns. Apply. - Wait for your indexes to re-build.
- (If it's still not working) File > Invalidate caches & restart.
GOTO File > Settings > Langauges & Frameworks > Python Template languages
Select Django in the Template language drop-down.
Jetbrains Docs > Python Template Languages
Nothing here worked for me but Enabling Django support in the settings did:
- Settings > Languages & Frameworks > Django
- Check of "Enable Django Support"
- Fill in the information for your project.