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. Django学习系列之模板

    什么是django模板 模板是一个文本,用于分离文档的表现形式和内容,模板定义了占位符以及各种用于规范文档该如何显示的各部分基本逻辑(模板标签) 模板通常用于产生HTML 如何使用模板 创建一个Tem ...

  2. ubuntu Install Firefox

    Firefox 下载文件以.tar和.bz2格式保存,必须从这些压缩包中提取文件.不想删除当前安装的 Firefox,给每个版本的 Firefox 创建一个单独的文件夹. 例如:1.Firefox 版 ...

  3. Centos 备份 还原

    備份: tar cvpzf backup.tgz / --exclude=/backup.tgz --exclude=/mnt 記得一定要排除備份文件本身哦! 還原: tar xvpfz backup ...

  4. 菜鸟学python-基础(2)

    变量命名: 1)必须以字符或下划线开头 2)以单下划线开头(_fo)表示不能直接訪问的类属性,须要类提供的接口进行訪问 3)以双下划线开头(__foo)的代表类的私有成员 4)以双下划线开头(__fo ...

  5. hdu 4778 Gems Fight!

    第一次写状压dp-- 题意:http://blog.csdn.net/dyx404514/article/details/15506601 状压dp+博弈吧-- #include<iostrea ...

  6. Linux watchdog 6300esb

     基本原理: Linux 自带了一个 watchdog 的实现,用于监视系统的执行,包含一个内核 watchdog module 和一个用户空间的 watchdog 程序.内核 watchdog ...

  7. YTU 2633: P3 数钱是件愉快的事

    2633: P3 数钱是件愉快的事 时间限制: 1 Sec  内存限制: 128 MB 提交: 387  解决: 215 题目描述 超市收银员的钱盒里,各种钞票总是按照面额分类整理,这样做可以提高效率 ...

  8. ubuntu将mysql、nginx添加到环境变量中

    vim /etc/profile 添加 export PATH="$PATH:/usr/local/mysql/bin" export PATH="$PATH:/usr/ ...

  9. finger的使用

    finger命令用来查询一台主机上的登录账号的信息,通常会显示用户名.主目录.停滞时间.登录时间.登录Shell等信息,使用权限为所有用户. 安装 sudo apt-get install finge ...

  10. SparkSQL与Hive on Spark

    SparkSQL与Hive on Spark的比较 简要介绍了SparkSQL与Hive on Spark的区别与联系  一.关于Spark 简介 在Hadoop的整个生态系统中,Spark和MapR ...