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

Posted 天道酬勤

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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.

以上是关于django-registration (1048, “Column 'last_login' cannot be null”)的主要内容,如果未能解决你的问题,请参考以下文章

Django-Registration:电子邮件作为用户名

包含 django-registration 的 url

django-registration 与 paypal 集成

django-registration 和 CSS 文件

为 django 1.5 自定义用户模型子类化 django-registration 1.0 表单

django-registration 中的 Urls 配置