执行manage.py syncdb提示Unknown command: 'syncdb'
1. 实验环境
ubuntu14.4 + django1.9.7
2. 问题描述
在配置完数据库mysite/settings.py后,通常需要运行
python manage.py syncdb
为数据库中每个应用建立一个数据库表。
然而如果你安装的Django Version >= 1.9,那么会出现如下问题:
gzxultra@gzxultraPC:~/django_try/mysite$ python manage.py syncdbUnknown command: 'syncdb'Type 'manage.py help' for usage.gzxultra@gzxultraPC:~/django_try/mysite$ python manage.py syncdbpython manage.py syncdbUnknown command: 'syncdbpython'Type 'manage.py help' for usage.
3. 解决方法
在stackoverflow上找到原因和解决方法:
syncdb is deprecated because of the migration system.
Now you can log your changes using makemigrations. This transforms your model changes into python code to make them deployable to another databases.
After you created the migrations you have to apply them: migrate.
So instead of using syncdb you should use makemigrations and then migrate.
简言之:在Django 1.9及未来的版本种使用migrate代替syscdb.
./manage.py migrate
执行manage.py syncdb提示Unknown command: 'syncdb'的更多相关文章
- ssh执行远程服务器脚本 提示php: command not found
ssh执行远程服务器脚本 提示php: command not found 设置环境变量 一台机器作为管理机,来管理其他服务器,并通过key认证,免密码登陆的. 在管理机上通过ssh登陆到其他服务器来 ...
- python manage.py syncdb Unknown command: 'syncdb'问题解决方法
在django1.9后的版本中,python manage.py syncdb命令修改为python manage.py migrate,执行正常. 选择sqlite可视化sqlitestudio-3 ...
- 执行 Run manage.py Task 报 AttributeError: 'Command' object has no attribute 'usage'?
这个问题,是python与Pycharm不兼容导致,解决办法将Pycharm升级最新版本
- python manage.py syncdb报错:No module named MySQLdb
今天同步数据时出现这个错误: 解决方法: 1.先下载mysql-python 支持1.2.3-2.7版本 MySQL-python 1.2.3 for Windows and Python 2.7, ...
- Django提示Unknown database处理方法
cmd.exe运行别人的程序 C:\Python27\Python.exe E:\Django\Guest\Guest\manage.py runserver 提示 django.db.utils.I ...
- django 1.7之后python manage.py syncdb没有了
在命令行输入python manage.py createsuperuser按照提示输入即可记得先初始化表. django>1.7 python manage.py makemigrations ...
- django系列 1 :python+django环境搭建 +mac提示找不到manage.py命令
1.安装python3 2.设置python3的环境变量 3.进入命令行模式,输入 pip install django 1.10.3 4.验证是否安装完成 pip show django 5.dja ...
- linux后台执行./run.py提示python syntax error near unexpected token `('
python脚本中的#!/usr/bin/python 估计有不少人注意过一些python脚本开头有这么行东东: #!/usr/bin/python 它是用来干嘛的?貌似没有它对脚本功能也没啥 ...
- Python ----pip安装模块提示“unknown or unsupported command install”的解决办法
安装pip后,使用pip安装模块时,提示“unknown or unsupported command install” 解决方法: 1.cmd运行"where pip" 找出所有 ...
随机推荐
- ios 初体验<窗口的创建>
1. 创建工程,这步很简单,百度下即可,在info.plist 里面 去掉 Main 的 ,便于新手练习ios,创建ios工程后,在AppDelegate.m,里面的方法application 加上几 ...
- Mock Server 入门
Mock Server介绍 什么是mock ? 我在去年的时候介绍一篇幅 python mock的基本使用,http://www.cnblogs.com/fnng/p/5648247.html 主要是 ...
- c#反射执行静态方法
发射调用System.Environment.Exit(0)示例: System.Reflection.Assembly ass = System.Reflection.Assembly.LoadFi ...
- Mac环境下mysql初始化密码问题--If you lose this password, please consult the section How to Reset the Root Password in the MySQL reference manual.
个人在Mac上操作数据库,遇到的启动数据库问题的简单记录 1.苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务(点击stop mysql server) 2.进 ...
- 转:【Java并发编程】之八:多线程环境中安全使用集合API(含代码)
转载请注明出处:http://blog.csdn.net/ns_code/article/details/17200509 在集合API中,最初设计的Vector和Hashtable是多线程安 ...
- 【2017集美大学1412软工实践_助教博客】团队作业6——展示博客(Alpha版本)
题目 团队作业6: http://www.cnblogs.com/happyzm/p/6791211.html 团队成绩 团队成员简介 项目地址 项目目标,包括典型用户.功能描述.预期用户数量 如何满 ...
- 1001.A+B Format (20)代码自查(补足版)
1001.A+B Format (20)代码自查(补足版) 谢谢畅畅酱的提醒,发现了代码中的不足,把变量名更改成更合理的名字,并且把注释也换成英文啦! 栋哥提供的代码自查的方式也帮助了我发现很多代码中 ...
- 第二次项目冲刺(Beta阶段)5.24
1.提供当天站立式会议照片一张 会议内容: ①检查前一天的任务情况. ②制定新一轮的任务计划. 2.每个人的工作 (1)工作安排 队员 今日进展 明日安排 王婧 #63Web输出以文件名为标题 #63 ...
- 学号:201521123116 《java程序设计》第七周学习总结
1. 本周学习总结 2. 书面作业 Q1 ArrayList代码分析 1.1 解释ArrayList的contains源代码ArrayList的contains源代码 1.2 解释E remove(i ...
- 预防黑客入侵 防黑必学的cmd命令vs网络安全
这些命令又可*********三类:网络检测(如ping).网络连接(如telnet)和网络配置(如netsh).前面两种相对简单,本文只介绍两个网络配置工具.自带的关于网络的命令行工具很多,比如大家 ...