Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

202
Vistas
Bootstrap help-block and Django registration form help_text

I am using the django.contrib.auth registration form and trying to get the help text to display consistently for all fields using Bootstrap.

I am using the following code in my Django template for the help text as part of a for loop on the form:

<p class="help-block">{{ field.help_text }}</p>

This works fine apart from the help text for the password field where it displays with the html tags:

password field help with tags

To prevent this I changed the code above to:

<p class="help-block">{{ field.help_text|safe }}</p>

But now the help text is not being formatted by Bootstrap, I guess because of the html inside the paragraph block.

help-block no longer formatting

Is there an obvious step I'm missing or is there another way this can be done?

Thanks.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Okay, late answer, but you can override the help text in the form, and make it whatever you want.

For example:

class MyRegistrationForm(RegistrationForm):
    def __init__(self, *args, **kwargs):
        super(MyRegistrationForm, self).__init__(*args, **kwargs)
        self.fields['password'].help_text = 'Password help text with whatever tags you want.'
over 4 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 Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda