0

It is way easier to work with django forms, however they are not as good looking as a form created with bootstrap (I am using bootstrap for frontend), my question is:

Is there any way I can give style to my django form to have something like this: enter image description here

Currently I am using a django form and including some widgets to customize, but I think I limited to control-form, here is my code:

class societyForm(forms.ModelForm):
    class Meta:
        model = sociedad
        fields = '__all__'
        widgets = {
            'name': forms.TextInput(attrs={'class': 'form-control'}),
            'RUC': forms.TextInput(attrs={'class': 'form-control'}),
            'NIT': forms.TextInput(attrs={'class': 'form-control'}),
            'resident_agent': forms.TextInput(attrs={'class': 'form-control'}),
            'president': forms.TextInput(attrs={'class': 'form-control'}),
            'vicepresident': forms.TextInput(attrs={'class': 'form-control'}),
            'secretary': forms.TextInput(attrs={'class': 'form-control'}),
            'incorporation_date': forms.TextInput(attrs={'class': 'form-control'}),
            'expiration': forms.TextInput(attrs={'class': 'form-control'}),
            'contact': forms.TextInput(attrs={'class': 'form-control'}),
            'email': forms.TextInput(attrs={'class': 'form-control'}),
            'phone': forms.TextInput(attrs={'class': 'form-control'}),
            'status': forms.TextInput(attrs={'class': 'form-control'}),
            'comments': forms.TextInput(attrs={'class': 'form-control'}),
        }

Ideas, tips and suggestions will be very appreciated.

Adrian
  • 71
  • 5

1 Answers1

0

Django Forms and Bootstrap - CSS classes and <divs>

were you check this question before ?

and I'm usually using django-crispy-form to give style

maybe it's what you were looking for

DolXeGoD
  • 33
  • 1
  • 5