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”)的更多相关文章

  1. 解决"django-registration(1048,“column”last_login“不能为null”)

    去数据库(MySQL终端): 1.查看django_migrations表的信息.如果你看到一些记录,删除它们(如果migrations目录下有原来的配置,需要清除). mysql> SELEC ...

  2. com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be null

    com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column 'goodsName' cannot be n ...

  3. You can add an index on a column that can have NULL values if you are using the MyISAM, InnoDB, or MEMORY storage engine.

    w https://dev.mysql.com/doc/refman/5.7/en/create-index.html MySQL :: MySQL 5.7 Reference Manual :: B ...

  4. sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) Cannot add a NOT NULL column with default value NULL [SQL: u'ALTER TABLE address_scopes ADD COLUMN ip_version INTEGER NOT NULL']

    root@hett-virtual-machine:~# su -s /bin/sh -c "neutron-db-manage --config-file /etc/neutron/neu ...

  5. mysql.connector.errors.IntegrityError: 1048 (23000): Column 'request_url' cannot be null

    箭头指向的2的方向 少了一个request_url的值 调试: 直接 执行sql语句 是没问题的, 这样就知道问题是出在代码的逻辑 处理了: INSERT INTO response_time (nu ...

  6. django migrate10060 Duplicate column name错误

    这个错误意思是有重复的列名,其实大部分原因是因为某些列被执行了多次,可以打开migration里面的django生成的文件去排查错误,然后自己手动修改数据库还原,实在不行可以把除了0001和init文 ...

  7. mysql5.7 column cannot be null

    背景 独立测试环境安装了数据库,但安装的版本是mysql 5.7的版本,而研发用的是mysql5.6的版本,在执行某个数据库操作的提示,提示column “xxxx”cannot be null 问题 ...

  8. Django开发常见问题

    1.Django设置中文,和时区.静态文件指向 #========================================================== # 设置时区 注意注释上面的:L ...

  9. django manytomany

    转载:http://my.oschina.net/u/572994/blog/105280 例如有如下模型 models.py ? 1 2 3 4 5 6 7 from django.db impor ...

随机推荐

  1. 程序猿是如何解决SQLServer占CPU100%的--马非码

    http://www.cnblogs.com/marvin/p/ASolutionForSQLServerCauseHighCPU.html

  2. Jsp+servlet 验证码案例

    昨晚在csdn看到一位前辈写一个ajax+servlet+jsp验证.顿时心血来潮,在阅读前辈的代码下我亲手体验一下,做了一个验证码生成工具类.以供大家做个參考. 1:加入VeriyCodeUtils ...

  3. k-d树及八叉树

    http://en.wikipedia.org/wiki/K-d_tree http://en.wikipedia.org/wiki/Octree

  4. Java设计模式—单例设计模式(Singleton Pattern)全然解析

    转载请注明出处:http://blog.csdn.net/dmk877/article/details/50311791 相信大家都知道设计模式,听的最多的也应该是单例设计模式,这种模式也是在开发中用 ...

  5. vSphere,ESXi,vCenter之间的关系

    vSphere是什么? vSphere 是VMware公司公布的一整套产品包,包括类似于VMware ESXi hypervisor.VMware vCenter Server等产品 ESXi是什么? ...

  6. 图像处理之基础---基于opencv的灰度图像微分

    argv分别为,可执行文件名.读入的原始图像.输出原始图像的灰度值.输出原始图像灰度值沿x轴方向的一阶微分.输出原始图像灰度值沿x轴方向的二阶微分. #include #include #includ ...

  7. c# GDI+绘制不同字体的字符串

    一段字符串中可能既有汉字又有字母,对于汉字和字母分别采用不同的字体进行绘制直接po代码了 Bitmap bmp = new Bitmap(iWidth, iHeight); Graphics g = ...

  8. bzoj2709: [Violet 1]迷宫花园

    二分答案,spfa check就行了. gb题卡精度. #include<cstdio> #include<iostream> #include<cstring> ...

  9. YTU 2623: B 抽象类-形状

    2623: B 抽象类-形状 时间限制: 1 Sec  内存限制: 128 MB 提交: 235  解决: 143 题目描述 定义一个抽象类Shape, 类中有两个纯虚函数. 具体类正方形类Shape ...

  10. C# oracle 参数传递的多种方式 留着复习

    ORA-01036 非法的变量名/编号,(解决) 博客分类: oracle SQL  下边的代码就会造成  ORA-01036 非法的变量名/编号 cmd.CommandText = "SE ...