Attendece program, saving all entries at the same time

How can i save the form and add the course name and student name in the views.
class Attendence (models.Model):
    date = models.DateField(, blank=True)
    course = models.ForeignKey(Class, null=True,  on_delete=models.CASCADE)
    student = models.ForeignKey(Class_member, null=True,  on_delete=models.CASCADE)
    attendence = models.BooleanField(default=False)

class Course_member (models.Model):
    student = models.ForeignKey(Student, null=True,  on_delete=models.SET_NULL)
    course = models.ForeignKey(Course, null=True,  on_delete=models.CASCADE)
class Course (models.Model):
    name = models.CharField(max_length=200)
    teacher = models.ForeignKey(Techer, null=True,  on_delete=models.SET_NULL)
def attendence (request, cource_id):
    course = Course.objects.get(id=course_id)
    students = Course_member.objects.filter(course=course)
    attendence_list = Attendence.objects.filter(course=course)
    form = attendence_form()

    if request.method == 'POST':
        if form.is_valid():
            return redirect ('db_app:courses')
    context = {'attendence':attendence_list, 'form':form, 'students':students, 'course':course}
    return render(request, 'db_app/attendence_course.html', context)
class Attendence_form(forms.ModelForm):
    class Meta:
        model = Attendence
        fields = ['date','student','course','attendence']
        labels = {'attendence':'',}

<form action="{% url 'db_app:attendence' %}" method="POST">
  <table class="table">
          <th >Name</th>
          <th >{{}}</th>
      {% for student in students %}
          <td> {{ student }} </td>
          <td> {{ form.attendence | as_crispy_field }} </td>
      {% endfor %}
  <button class="btn btn-primary" name="submit">Save</button>

You can create your views to contain multiple forms - the mechanics are going to depend upon
whether or not you want one button to submit everything.

If you’ve got multiple students to display in the same form, you can use formsets to create a set of repeated forms for the same model.

You can validate those forms and save them all in the “POST” section of the view.