PyCharm 5 can't find Django 1.9 templates

心不动则不痛 提交于 2019-12-07 08:28:45

问题


When I'm debugging my app with PyCharm 5.0.3, I want to insert a few breakpoints into template files (Django 1.9).

However, when I run app in PyCharm debug mode, it prints the following warning as soon as it processes the first request.

WARNING: Template path is not available. Please set TEMPLATE_DEBUG=True in your settings.py to make django template breakpoints working

I've read here that TEMPLATE_DEBUG has been deprecated and I already have this setting in the new format. I've also tried marking the templates directory as "Template Folder" as per another Stackoverflow post, but it doesn't help.

Has anyone seen this issue before? Here are my settings

BASE_DIR = os.path.dirname(os.path.dirname(__file__))
DEBUG = True
TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'debug': DEBUG,
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

回答1:


I got a reply from PyCharm, it's a known issue and will be fixed in then next release.

https://youtrack.jetbrains.com/issue/PY-17923



来源:https://stackoverflow.com/questions/34524102/pycharm-5-cant-find-django-1-9-templates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!