I am trying to add MultiSelectField in a django template. I implemented the below code, but there is a problem in the template. However, in django admin it is working perfectly.
#models.py
from multiselectfield import MultiSelectField
    class Amenities(models.Model):
        Amenities_Choices =(
            ('Free Wifi','Free Wifi'),
            ('Attach Bathroom', 'Attach Bathroom'),
            ('Shared Bathroom', 'Shared Bathroom'),
            ('Free Laundry Service', 'Free Laundry Service',),
            ('24/7 water facility', '24/7 water facility'),
            ('Geyser', 'Geyser'),
            ('Private TV', 'Private TV'),
        )
        hostel = models.ForeignKey(AddHostel, on_delete=models.CASCADE)
        feature = MultiSelectField(choices=Amenities_Choices)
    
        def __str__(self):
            return self.hostel.location
views.py:
def amenities(request):
    if request.method == "POST":
        hostel = request.POST['hostel']
        feature = request.POST['feature']
        amen = Amenities(hostel_id=hostel, feature=feature)
        amen.save()
    hostels = AddHostel.objects.all()
    return render(request,'staff/amenities.html',{'hostels':hostels})
    <div class="col-lg-12">
                    <form method="post">
                        {% csrf_token %}
                        <div class="row">
                            <div class="form-group col-md-6 col-sm-12">
                                <label for="hostel">Hostel:</label>
                                <select class="form-control form-search-ch" id="hostel" name="hostel">
                                    {% for h in hostels %}
                                        <option value="{{ h.id }}">{{ h.hostel_name }}</option>
                                    {% endfor %}
                                </select>
                                {#                            <input type="text" class="form-control form-grp-lbl" id="hostel" name="hostel"#}
                                {#                                   required>#}
                            </div>
                            <div class="form-group col-md-6 col-sm-12">
<!--in this section checkbox is not showing-->
                                {% for value, text in form.amenities.field.choices %}
                                    <div class="ui slider checkbox">
                                        <input id="{{ forloop.counter0 }}" name="{{ form.feature }}"
                                               type="checkbox" value="{{ feature }}"{% if value in checked_feature %}
                                               checked="checked"{% endif %}>
                                        <label>{{ text }}</label>
                                    </div>
                                {% endfor %}
                            </div>
                            <div class="form-group col-md-12 mx-auto">
                                <input type="submit" class="form-control"
                                       name="register" value="Add"
                                       style="width:150px; height: 50px; font-size: 1.2rem; border-radius: 10px 10px;background: #E35452;  border: 1px solid rgba(0,0,0,0.5); color: #ffffff">
                            </div>
                        </div>
                    </form>
                </div>