1/执行python manage.py sqlall 命令报错,怎么回事?
答:这是因为旧版本和新的版本命令已经不一样 的问题。新版的命令做了修改,写好自己的model以后可以换成这样的命令来生成数据库表:
python manage.py makemigrations books
#结果:
Migrations for 'books':
0001_initial.py:
- Create model Author
- Create model Book
- Create model Publisher
- Add field publisher to book
#然后:
python manage.py sqlmigrate books 0001
这样就可以CREATE TABLE 了。
2/ You appear not to have the ‘sqlite3’ program installed or on your path.
答:????