class Bar(forms.Form):

    def __init__(self, fields, *args, **kwargs):
        super(Bar, self).__init__(*args, **kwargs)
for i in range(fields):
    self.fields['my_field_%i' % i] = forms.Charfield()
Variable number of inputs with Django forms possible?