How to assign Django fields to html fields, Without adding form in html?

By | July 21, 2016
 

Django fields to html fields

This is the simple answer you can have your own form but not use {{ form }} just give the input tag in it.

<input type=”text1″ name=”<your name1″>

Please note this point the given (name) should match  your database fields.

yes you can of course create the customize form

class Your Form(forms.ModelForm):

class Meta:

model = YourModel

widgets = {

‘your_field’: forms.TextInput(attrs={‘class’: ‘yourFieldClass’}),

}