-- Enter the DB shell with `./manage.py dbshell`
-- Get latest ID
SELECT id FROM "django_admin_log" ORDER BY id DESC LIMIT 1;
-- Set the next value of the ID sequence to the result of the first query + 1
SELECT setval('django_admin_log_id_seq', LASTID + 1);
-- (replace `LASTID` with the result of the first query)