[Django]-ValueError: invalid literal for int() with base 10:

5👍

I am no Django expert, but try replacing

EmployeeDetails(userName,designation,employeeID,contactNumber,project,dateOfJoin).save() 

with

EmployeeDetails(userName=userName,designation=designation,employeeID=employeeID,contactNumber=contactNumber,project=project,dateOfJoin=dateOfJoin).save() 
👤NPE

7👍

Don’t use positional arguments, use keywords to specify which field is being populated with what data.

EmployeeDetails(userName=userName, designation=designation) #etc

Also, if you are going to call save() anyways, you can use EmployeeDetails.objects.create(...)

Leave a comment