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.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Chris Curvey's avatar
246
Chris Curvey
asked 7 years ago
Wingware Support's avatar
4.2k
Wingware Support
updated 5 years ago

Comments

see more comments

1 Answer

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,
        },
    },
]

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Wingware Support's avatar
4.2k
Wingware Support
answered 7 years ago
Wingware Admin's avatar
231
Wingware Admin
updated 5 years ago
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 (7 years ago)

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 (7 years ago)

Ah, that was it.  Thanks!

Chris Curvey's avatar Chris Curvey (7 years ago)
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

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)