Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

203
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!