Manage.py sqlall不在我的应用程序中为模型创建表 [英] Manage.py sqlall doesn't create tables for models in my app

查看:39
本文介绍了Manage.py sqlall不在我的应用程序中为模型创建表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为我的应用程序中的模型创建一个表,显然 python manage.py sqlall myapp不起作用

I want to create a table for my models in my app, apparently the "python manage.py sqlall myapp" doesn't work

我尝试使用 python manage.py sqlmigrate myapp,我仍然收到错误

I tried using the "python manage.py sqlmigrate myapp", i still get errors

要使用的正确命令是什么?

what is the proper command to use?

我正在使用django 1.11.7
谢谢

i am using django 1.11.7 thanks

推荐答案

sqlmigrate 命令只是打印出要迁移的SQL,它不会运行它。您应该运行 migrate 进行更改。

The sqlmigrate command just prints out the SQL for the migration, it does not run it. You should run migrate to make the changes.

请参见迁移文档以获取有关迁移命令的更多信息。

See the Migrations docs for more information about the migration commands.

sqlall 命令为在Django 1.9中删除了,同时删除了 syncdb

The sqlall command was removed in Django 1.9 at the same time as syncdb was removed.

这篇关于Manage.py sqlall不在我的应用程序中为模型创建表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆