Import Data (csv) to django

following the creation of a multi-profile user portal on a POSTGRES SQL database, I wanted to import a csv format to add my users to the database.
I can see the profiles in the administration portal.

I have an error when I try to connect with one of these imported profiles, it returns invalid information.

Also in the administration portal, in addition to my imported profiles, I encounter an error when I want to create a new profile.

See message:

IntegrityError at /admin/authentication/accounting/add/
ERROR: the value of a duplicate key breaks the unique constraint “authentication_comptabilite_pkey”
DETAIL: The key “(id)=(3)” already exists.

I restarted gunicorn, but nothing changed.

Do you have any idea what I forgot to do?

There are a couple different things that might be wrong.

We need to start by seeing your model definitions.

Also, a small sample of the csv data you imported might be helpful along with a description of how you loaded that data into your database.

Regarding the duplicated key error: If you imported data with a primary key, then your sequence for that table didn’t get updated to reflect that the data was added. You need to update that value for primary keys to be properly assigned.

Please do not post screenshots of code - and as far as possible not of data either.

Copy/paste the text, code, template, or data directly into the body of your message surrounded by lines of three backtick - ` characters. This means that you’ll have a line of ```, then your code, etc, then another line of ```.
(I can read the data fragment, you don’t need to repost that here, but I can’t read that code.)