samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$ python manage.py sqlall getssh
System check identified some issues: WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
CommandError: App 'getssh' has migrations. Only the sqlmigrate and sqlflush commands can be used when an app has migrations.
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$ mv migrations/ migrations.back/
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh/getssh$
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$ python manage.py sql getssh
System check identified some issues: WARNINGS:
?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values of the following settings into your default TEMPLATES dict: TEMPLATE_DEBUG.
BEGIN;
CREATE TABLE `getssh_publisher` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`name` varchar(30) NOT NULL,
`address` varchar(50) NOT NULL,
`city` varchar(60) NOT NULL,
`state_province` varchar(30) NOT NULL,
`country` varchar(50) NOT NULL,
`website` varchar(200) NOT NULL
)
;
CREATE TABLE `getssh_author` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`first_name` varchar(30) NOT NULL,
`last_name` varchar(40) NOT NULL,
`email` varchar(254) NOT NULL
)
;
CREATE TABLE `getssh_book_authors` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`book_id` integer NOT NULL,
`author_id` integer NOT NULL,
UNIQUE (`book_id`, `author_id`)
)
;
ALTER TABLE `getssh_book_authors` ADD CONSTRAINT `author_id_refs_id_20f26b36` FOREIGN KEY (`author_id`) REFERENCES `getssh_author` (`id`);
CREATE TABLE `getssh_book` (
`id` integer AUTO_INCREMENT NOT NULL PRIMARY KEY,
`title` varchar(100) NOT NULL,
`publisher_id` integer NOT NULL,
`publication_date` date NOT NULL
)
;
ALTER TABLE `getssh_book` ADD CONSTRAINT `publisher_id_refs_id_99765d4d` FOREIGN KEY (`publisher_id`) REFERENCES `getssh_publisher` (`id`);
ALTER TABLE `getssh_book_authors` ADD CONSTRAINT `book_id_refs_id_2cfb1c02` FOREIGN KEY (`book_id`) REFERENCES `getssh_book` (`id`); COMMIT;
samcao@samcao-Lenovo-IdeaPad-Y470:~/caodjango/caossh$

提示Only the sqlmigrate and sqlflush commands can be used when an app has migrations.

将apps目录下面的migrations文件夹删除掉,或者重命名一下即可.

Only the sqlmigrate and sqlflush commands can be used when an app has migrations.的更多相关文章

  1. python3.4 + Django1.7.7 表单的一些问题

    上面是没有调用cleaned_data的提交结果,可见模版直接把form里面的整个标签都接收过来了 下面是调用cleaned_data 的结果 django 的表单,提交上来之后是这样的: #codi ...

  2. python 杂项

        Python/JS/    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...

  3. Django Drops

    1.Django Intro 2.Django Install (1) PIP安装 sudo apt-get isntall python-pip sudo pip install Django (2 ...

  4. Django commands自定制

    什么是Django Commands Django 对于命令的添加有一套规范,你可以为每个app 指定命令.通俗一点讲,比如在使用manage.py文件执行命令的时候,可以自定制自己的命令,来实现命令 ...

  5. laravel administrator 一款通用的后台插件(PHP框架扩展)

    前几天我看了一下zend framework 2的一些官方文档,也找了一些例子,可惜所有的资料少之甚少.于是我就开始去找这国外用的比较流行的PHP框架laravel,希望能够找到其合适的例子,而且我本 ...

  6. [转]Composer 中国镜像

    用法: 有两种方式启用本镜像服务: 将以下配置信息添加到 Composer 的配置文件 config.json 中(系统全局配置).见“例1” 将以下配置信息添加到你的项目的 composer.jso ...

  7. install kinect driver for ARM---38

    原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ The video describes connecting a Microsoft Kinect to ...

  8. [译]rabbitmq 2.1 Consumers and producers (not an economics lesson)

    我对rabbitmq学习还不深入,这些翻译仅仅做资料保存,希望不要误导大家. For now, all you need to know is that producers create messag ...

  9. git workflow常用命令

    git init git status git add readme.txt git add --all         Adds all new or modified files git comm ...

随机推荐

  1. ubuntu修改设备名称

    按住ctrl+alt+t打开终端 输入 sudo gedit /etc/hostname 出现一个打开的文件,显示的就是你的设备名字,也就是终端@的那个名字.将其修改成你想显示的名字,保存重启系统就可 ...

  2. 在PHP中使用CURL

    转载自:http://www.phpchina.com/article-40161-1.html

  3. Android7.0 新特性

    删除了三个隐式广播 1.监听网络变化的广播 CONNECTIVITY_ACTION,在Manifest.xml中注册的 不会受到,在前台运行的程序 registerReceiver()注册的广播可以接 ...

  4. AngularJS 2 VS Code Linter环境设置

    Angular Cli npm install -g angular-cli https://www.npmjs.com/package/angular-cli TSLinter 1.1 ext in ...

  5. 运行R 报错R cannot R_TempDir, 继而发现/dev/mapper/VG00-LV01 磁盘空间已满

    今天在运行R脚本的时候报了个错:Fatal error: cannot create 'R_TempDir'.排除了是自己写的代码的问题,想着应该是某个没见过的原因,google之,发现网上的说法是/ ...

  6. Kafka报错-as it has seen zxid 0x83808 our last zxid is 0x0 client must try another server

    as it has seen zxid 0x83808 our last zxid is 0x0 client must try another server 停止zookeeper,删除datadi ...

  7. 动态设置和访问cxgrid列的Properties(转)

    原文:http://www.cnblogs.com/hnxxcxg/archive/2010/05/24/2940711.html 动态设置和访问cxgrid列的Properties 设置: cxGr ...

  8. window7下karma 报 nodejs request TypeError: The header content contains invalid characters BUG

    这个BUG 估计只有中国人才 遇到 打开你的依赖node_modules\karma\node_modules\connect\lib\patch.js 将里面的setHeader方法改成下面这样,干 ...

  9. 使用Eclipse上传/下载Git项目

    使用Eclipse上传/下载Git项目 前提: Eclipse已安装EGit插件 已拥有GitLab / GitHub / 其它Git托管服务账号 SSH方式 配置 配置Git信息 配置用户信息 Ec ...

  10. linux 学习6 软件包管理 资料链接

    软件包管理 这一章看得比较随意 先大概记点东西. RPM安装很繁琐,因为依赖性,手动安装太麻烦. ______我觉得直接yum在线安装就好了,很直接方便. 但是要特别注意的地方 在用yum升级或者卸载 ...