[Answer]-Django try..except ValueError raised with no error

1๐Ÿ‘

I dont think ValueError is robust enough,

if the data is incorrect data type

int('test')

it raises a ValueError, so its not a sufficient way to check for the presence of fields.

A more robust way is to use djangos built in Forms. It will allow you to specify data types and required fields, and django will take care of the validation for you.

๐Ÿ‘คdm03514

Leave a comment