title: Using formset_factory in Django
body: <p>I'm a new user to Django, i use the following code to produce a form</p>
  
  <pre><code>class GetMachine(forms.Form):
      Machine_Name = forms.CharField(max_length=20) 
      Number_of_lines = forms.IntegerField(max_value=10)
  
  class GetLine(forms.Form):
      Line_name = forms.CharField(max_length=20)
  
  def install(request):
      if request.method == 'POST':
          form = GetMachine(request.POST) 
          if form.is_valid(): # All validation rules pass
              # Process the data in form.cleaned_data
              form = GetLine()
              return render_to_response('install.html', { 'form': form, })
      else:
          form = GetMachine() # An unbound form
  
      return render_to_response('install.html', { 'form': form, })    
  </code></pre>
  
  <p>How can modify the above code, such that the "Number_of_lines" is used to create n number of "Line_Name" form fields.</p>
  
  <p>For example, if the value of Number_of_lines is 2, I would again like to ask the user to enter the name of both the lines as</p>
  
  <p>Name of Line-1: </p>
  
  <p>Name of Line-2:</p>