django-registration (1048, “Column 'last_login' cannot be null”)

Go to your database (MySQL Terminal):

$ mysql

mysql> SELECT * FROM django_migrations;

If you see some records, good. Delete them.

mysql> TRUNCATE TABLE django_migrations;

Leave MySQL terminal, and run the migrations again in django:

$ python manage.py migrate --fake-initial

Make sure this message appears:

0005_alter_user_last_login_null - [OK]

then you might see some other conflicts, that is fine because we only need to make this migration.

Restart your MySQL and Server and you're good to go.

你可能感兴趣的