Django 1.8.13 saving new user gets error NOT NULL constraint failed: auth_user.last_login

469 views
Skip to first unread message

bobhaugen

unread,
Jul 21, 2016, 11:46:37 AM7/21/16
to Django users
NOT NULL constraint failed: auth_user.last_login


This is a new user. Why should it have a last_login value? 

I coded around it by giving the new user a fictitious last_login value, but still...

Simon Charette

unread,
Jul 21, 2016, 12:55:29 PM7/21/16
to Django users
If you upgraded from Django 1.7 you should make sure to run all auth migrations.

If you're using a custom user model make sure to makemigrations for its app and proceed to migrate it.

Simon

bobhaugen

unread,
Jul 21, 2016, 1:26:48 PM7/21/16
to Django users
Hah! You are right! My fault.
Reply all
Reply to author
Forward
0 new messages