python sqlite Error IntegrityError: UNIQUE constraint failed: table_area1.user_name

This error is caused by the fact that when you were building the table, you set the key to be UNIQUE. When a user with the same name appears, the user will report
user_name INT NOT NULL UNIQUE
It’s also possible that this is the key that you just want to make unique but you insert this key twice later
for example you insert something with id 1
and then you insert something with id 1 because you can only have one field with id 1 so you get an error here

Read More: