PyCharm code inspection complains template file not found, how to fix?

Just open the project view (view->tool windows -> project). There right-click on your templates-folder -> 'mark directory as'-> Template directory


Try adding TEMPLATE_LOADERS to your settings file if you don't have it. I think PyCharm looks for it and doesn't load it from Django default settings. It solved my problem.

settings.py:

TEMPLATE_LOADERS = (
    'django.template.loaders.filesystem.Loader',
    'django.template.loaders.app_directories.Loader',
)

If you have marked directory as template directory, but still get the warning, you can try changing the single quotes to double quotes

def home(request):
    return render_to_response('home.html')

change to this:

def home(request):
    return render_to_response("home.html")

Hope this helps.