0

How to show only the input field in Django crispy form.

<div class="">
     {{form1.username|as_crispy_field}}
</div>

enter image description here

how can it only show input field

AzyCrw4282
  • 7,222
  • 5
  • 19
  • 35
Ali Raza
  • 1,026
  • 13
  • 20

1 Answers1

1

If you want to remove labels from certain fields then you can do so by adding this to the Class responsible for your form.

self.fields['some_field'].label = False

Where some_field is the name of the field whose label you want to remove.

You can also see the answers here for different solutions to this problem.

AzyCrw4282
  • 7,222
  • 5
  • 19
  • 35