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
Source:stackexchange.com