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

295
Views
Custom CSS in Django Crispy forms

forms.py:

from django import forms

from .models import SignUp


from crispy_forms.helper import FormHelper
from crispy_forms.layout import Submit, Layout, Field

class ContactForm(forms.Form):
    full_name = forms.CharField( required=False)
    email = forms.EmailField()
    message = forms.CharField()




class SignUpForm(forms.ModelForm):


        class Meta:
            model = SignUp
            fields = ['full_name', 'email']
            ### exclude = ['full_name']
            helper = FormHelper()
            helper.layout = Layout(
            Field('full_name', css_class='container'),
            Field('email', css_class='input-sm'),
                ) 

The HTML I get shows that it using different CSS classes instead of the ones that are in the layout. Have I missed something? Am I doing something wrong? How do I add custom CSS to my form?

HTML:

<div id="div_id_full_name" class="form-group"> <label for="id_full_name" class="control-label ">
                Full name
            </label> <div class="controls "> <input class="textinput textInput form-control" id="id_full_name" maxlength="120" name="full_name" type="text" /> </div> </div> <div id="div_id_email" class="form-group"> <label for="id_email" class="control-label  requiredField">
                Email<span class="asteriskField">*</span> </label> <div class="controls "> <input class="emailinput form-control" id="id_email" maxlength="254" name="email" type="email" required /> </div> </div>
about 4 years ago · Santiago Trujillo
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!