Only the sqlmigrate and sqlflush commands can be used when an app has migrations.
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.的更多相关文章
- python3.4 + Django1.7.7 表单的一些问题
上面是没有调用cleaned_data的提交结果,可见模版直接把form里面的整个标签都接收过来了 下面是调用cleaned_data 的结果 django 的表单,提交上来之后是这样的: #codi ...
- python 杂项
Python/JS/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ...
- Django Drops
1.Django Intro 2.Django Install (1) PIP安装 sudo apt-get isntall python-pip sudo pip install Django (2 ...
- Django commands自定制
什么是Django Commands Django 对于命令的添加有一套规范,你可以为每个app 指定命令.通俗一点讲,比如在使用manage.py文件执行命令的时候,可以自定制自己的命令,来实现命令 ...
- laravel administrator 一款通用的后台插件(PHP框架扩展)
前几天我看了一下zend framework 2的一些官方文档,也找了一些例子,可惜所有的资料少之甚少.于是我就开始去找这国外用的比较流行的PHP框架laravel,希望能够找到其合适的例子,而且我本 ...
- [转]Composer 中国镜像
用法: 有两种方式启用本镜像服务: 将以下配置信息添加到 Composer 的配置文件 config.json 中(系统全局配置).见“例1” 将以下配置信息添加到你的项目的 composer.jso ...
- install kinect driver for ARM---38
原创博客:转载请标明出处:http://www.cnblogs.com/zxouxuewei/ The video describes connecting a Microsoft Kinect to ...
- [译]rabbitmq 2.1 Consumers and producers (not an economics lesson)
我对rabbitmq学习还不深入,这些翻译仅仅做资料保存,希望不要误导大家. For now, all you need to know is that producers create messag ...
- git workflow常用命令
git init git status git add readme.txt git add --all Adds all new or modified files git comm ...
随机推荐
- 初识makefile
Makefile的规则 目标 : 需要的条件 (注意冒号两边有空格) 命令 (注意前面用tab键开头) 解释一下: 1 目标可以是一个或多个,可以是Object File,也可以是执行文件,甚至可以是 ...
- ARCGIS如何进行可视域分析
可视域分析在不同的领域有着广泛的应用,如火灾监控点的设定,观察哨所的设定等等.军事领域是可视域分析技术应用最广的领域.例如为了设计巡航导弹的航线,就必须对发射点到目标的地形进行分析,包括地形特征优劣分 ...
- 关于web前端开发学习的顺序
学习web前端开发该怎么学,按照什么顺序学习,这是很多新手朋友会遇到的问题.下面简单的说一下.由于在国内大学课程里面,几乎没有前端开发这门课程,无非就是一些网页设计之类的课程,但那些课程无论是老师讲还 ...
- gb2312
---恢复内容开始--- 字符集 gb2312(字全)采用2两个字节(一个汉字) utf-8(只有汉字)采用3个字节(一个汉字) html就是负责描述页面的语义:css负责描述页面的样式:js负责描述 ...
- iOS常见算法笔试问题
1. 给出一个由小写字母组成的字符串,把所有连续出现的 2 个 a 替换成 bb ( 2 个 b ),但是对于超过两个连续的 a,那么这些字符都不作替换.例如: bad -> bad (一个a, ...
- editplus工具支持sql高亮提示
editplus默认不识别sql关键件,添加文件使其对sql高亮提示. 首先就是要自己编写一段代码,存为.stx 文件(例如sql.stx) 然后在editplus的菜单栏 工具-> 配置用户工 ...
- 灵活运用 SQL SERVER FOR XML PATH
FOR XML PATH 有的人可能知道有的人可能不知道,其实它就是将查询结果集以XML形式展现,有了它我们可以简化我们的查询语句实现一些以前可能需要借助函数活存储过程来完成的工作.那么以一个实例为主 ...
- 关于js作用域链,以及闭包中的坑
eg:链式作用域,想在外部读取blogName的值得方法 <script>var authorName="山边小溪";function doSomething(){ ...
- google垂直搜索结果
佰年金融 所谓“垂直”很干净地分离出来,而不是在谷歌算作有机列表的结果,但该行已开始模糊.例如,现在许多视频结果似乎是直接整合为有机(万SERP的例子).我治疗的新的“有深度的文章”作为一个垂直的结果 ...
- input[file]标签的accept=”image/*”属性响应很慢的解决办法
转自:http://blog.csdn.net/lx583274568/article/details/52983693 input[file]标签的accept属性可用于指定上传文件的 MIME类型 ...