• Empleos
  • Sobre nosotros
  • profesionales
    • Inicio
    • Empleos
    • Cursos y retos
  • empresas
    • Inicio
    • Publicar vacante
    • Nuestro proceso
    • Precios
    • Evaluaciones
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

245
Vistas
Error in included django template is not rendered

I have this simple template that uses the imgix plugin like so:

// template_b.html
{% get_imgix project.picture %} 

This line causes an error and should be replaced by

{% get_imgix project.picture.url %}

This piece of code is inside a template that is included:

// template_a.html
{% include "template_b.html" %}

It seems that when the template tags fails, in the first case (an AttributeError is raised), the template is simply ignored. No error is raised if the DEBUG setting is False.

While this is certainly useful to prevent any user-facing errors, it's still concerning to not have any kind of feedback.

Do you know where I can find more information related to this behavior and if there are ways to still be informed of the failure?

about 3 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

You're not the only person to have been caught out from this behaviour. See this discussion on the django-developers mailing list.

The silencing behaviour has been deprecated in Django 1.11. In Django 2.1 the exception will be raised. In Django 1.11 and 2.0 you get a deprecation warning if the include tag raises and exception, but the exception is silenced.

I don't have any good suggestions for earlier versions of Django. You could create your own include tag if it's really important to you.

about 3 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recomiéndame algunas ofertas
Necesito ayuda