I've been fighting with PyCharm for the last several weeks, trying to figure out why it was refusing to detect my apps' templates folders. It had worked in the past, but things changed recently (Perhaps with 2018.3? I'm not certain). Now, if APP_DIRS is set to anything except True in the initial definition of the Django TEMPLATES setting, PyCharm can't find my templates folders. Even setting it to True after the TEMPLATES = ['stuff'] line in settings.py doesn't fix the folder finding, which is really bizarre.
Here's a screenshot showing the folder detection actually working. Note that APP_DIRS is set to True in the definition of TEMPLATES:
Unfortunately, I can't use APP_DIRS = True in production, because it's slow and uncached. We use Django's cached template loader, like in this screenshot, which breaks the folder detection:
I've also tried using the uncached loader, but that's equally ineffective.
The REALLY weird thing is that setting APP_DIRS = False in the definition of TEMPLATES, and then setting it to True in the next line of settings.py still breaks the folder detection!
WTF?? How is that even possible? Is PyCharm, like, parsing the contents of settings.py to look for TEMPLATES = [ ... 'APP_DIRS': True ... ] or something?? I mean, it can't really be that, either, since I defined TEMPLATES in django.py, which is imported by settings.py. So what the heck is going on??
Please help me figure this out, as my brain is totally melted after all this frustration.