P
P
Pan Propan2016-03-04 23:26:22
Django
Pan Propan, 2016-03-04 23:26:22

How to setup Django template debugging in Pycharm?

I'm just getting started with Django. Please help me master debugging in Pycharm.
If I put a breakpoint in Views, then debugging works, variables are available for calculation.
If I put a breakpoint in the template, then the breakpoint does not work.
I have variables written in the template and they are exactly drawn from the model, otherwise my table with data would not be filled.
setting Templates in settings.py is like this

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],
        'APP_DIRS': True,
        'OPTIONS': {
            'TEMPLATE_DEBUG':'True',
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
                #"django.core.context_processors.media",
                #"django.core.context_processors.static",
            ],
        },
    },
]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
sim3x, 2016-03-04
@sim3x

so pycharm didn't understand where you have the template
https://www.jetbrains.com/pycharm/help/debugging-d...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question