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 ...
随机推荐
- java使用jsch连接linux
由于项目需要使用java来linux进行管理,近一番查找,发现第三方jar包 jsch 可以轻松实现对linux的管理,(相关文档及例子请访问官网www.jcraft.com),故引进. 在网上搜索了 ...
- arcgis基于地形数据的坡度分析
高程.坡度和坡向是小班中非常重要的因子,坡度对水土保持规划设计具有决定性的作用,是土地利用规划和治理措施配置首先要考虑的因素.如何利用地形数据对坡度进行分析呢,本文即将揭晓. 软件准备: locasp ...
- thinkPHP--SQL连贯操作
一.连贯入门 连贯操作使用起来非常简单,比如查找到 id 为 1,2,3,4 中按照创建时间的倒序的前两 位. //连贯操作入门 $user = M('User'); var_dump($user-& ...
- 关于SQL预编译问题。
标准都是sql.add('insert a (b,c,d)values(:a,:b,:c)');params.parambyname('a').asstring:='';...
- {Reshipt}{文白}{资治通鉴}
this article came from 360doc ====================================================================== ...
- 学习Linux入门50个基本命令
Linux系统以一切皆文件的方式运行系统.虽然存在ubuntu版本的图形界面,但在企业的服务器里面还是以命令行系统运行为主. 以下是初学50个基本的Linux命令行的体会 1:pwd 显示当前你所在的 ...
- DOM Document
1.DOM Document对象 定义:每个载入浏览器的 HTML 文档都会成为 Document 对象.Document 对象使我们可以从脚本中对 HTML 页面中的所有元素进行访问. Docume ...
- MFC控件的SubclassDlgItem
MFC控件的SubclassDlgItem 要在程序中创建新设计的控件,显然不能用自动创建的办法,因为对话框模板对新控件的特性一无所知.程序可以用手工方法创建控件,在调用派生类的Create函数时,派 ...
- JQuery动画效果
jquery动画效果常用方法 1.show()显示效果语法:show(speed,callback)Number/String,Function speend为动画执行时间,单位为毫秒.也可以为slo ...
- python第二天-linux权限管理
(1)linux登陆密码忘了,怎么办? 把系统重启,在进入系统之前不断的按键盘左上角的"Esc"键会进入这样一个画面,按键盘上的e进入编辑. 进入这个画面以后,通过键盘的上下方向键 ...