First time here? Check out the FAQ!
1

TEMPLATE_DEBUG warning messages?

I use Wing to work on my Django projects, and I have dutifully set TEMPLATE_DEBUG in my settings file.  Does anyone know how to suppress this error message that I get every time any Django process starts?

The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.

Chris Curvey's avatar
246
Chris Curvey
asked 2017-12-19 11:09:00 -0600
Wingware Support's avatar
4.2k
Wingware Support
updated 2019-03-13 08:52:21 -0600
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

2 Answers

1

In the TEMPLATES  section of your settings.py you want to add a line that says "'debug': True,"Wing's project setup scripts should be doing that for Django >= 1.9 instead of setting TEMPLATE_DEBUG.Here's an example that works for me with Django 1.11:

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        'debug': True,
        },
    },
]
Wingware Support's avatar
4.2k
Wingware Support
answered 2017-12-19 11:40:00 -0600
Wingware Admin's avatar
270
Wingware Admin
updated 2019-03-07 08:39:29 -0600
edit flag offensive 0 remove flag delete link

Comments

Hmm, I'm on Django 1.11 -- when I do that, I don't get a warning message on startup, but when I render a template, I get:ImproperlyConfigured: Unknown parameters: debug

Chris Curvey's avatar Chris Curvey (2017-12-19 12:26:00 -0600) edit

Are you sure the 'debug: True line is inside the OPTIONS dict?  In the above, the indentation is wrong and makes it look like it's within the top-level dict instead, but it's part of the dict after OPTIONS.

Wingware Support's avatar Wingware Support (2017-12-19 13:16:00 -0600) edit

Ah, that was it.  Thanks!

Chris Curvey's avatar Chris Curvey (2017-12-19 15:03:00 -0600) edit
add a comment see more comments
0

Hello I am i Django 5.1 . In my settings I have Templates ['OPTIONS']['debug'] : True In my project properties I have eneble wing to debug django templates. Yet wing never stops in a django template.

piscvau's avatar
581
piscvau
answered 2025-02-16 10:43:40 -0600
edit flag offensive 0 remove flag delete link

Comments

This should be a new question, not added as an answer here. One thing to try is to enable the Debugger > Advanced > Use Legacy Tracer Core with Python 3.12 preference, in case the new Python debugger support is incompatible with the hack used to make Django template debugging work. I suspect that is the problem, and it's possible we won't be able to re-add that capability with the new debugger implementation. Django templates weren't really designed to be debugged so at least in my opinion, as the author of that code any years ago when Django was new, it never worked that well. Please let us know if setting that preference helps so we can follow up with this internally.

Wingware Support's avatar Wingware Support (2025-02-20 06:47:47 -0600) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer