I’m currently making a django website, and I’m confused between using Django-Forms and the traditional hand coded HTML forms.
HTML forms works in my favor in many ways, but I’ve also tried django forms and they definitely have their advantages.
Any help on this will be appreciated.
I’m currently making a django website, and I’m confused between using Django-Forms and the
Share
In my opinion Django forms is great when you have a simple application that gets data from a user in a format that is close to the way that you want to store it in the database. In this scenario you can simply write the model and use model forms to generate the correct HTML for you form.
You can also use forms to get data from the user that doesn’t correspond to a model by using a normal form and defining its properties.
With Django forms you also get some validation for free, you can make fields optional or required and you can create drop down options.
Where it gets a little more difficult is when you have certain fields that you want to display in a custom way. You can still use Django forms, but you need to work a little harder.