在此处跟随Django by Example教程:http://lightbird.net/dbe/todo_list.html
本教程说:
“这改变了我们的表布局,我们必须要求Django重置并重新创建表:
manage.py reset todo; manage.py syncdb”
但是,当我运行时manage.py reset todo,出现错误:
manage.py reset todo
$ python manage.py reset todo - Unknown command: 'reset'
这是因为我使用的是sqlite3而不是Postgresql吗?
有人可以告诉我重置数据库的命令是什么吗?
命令:python manage.py sqlclear todo返回错误:
python manage.py sqlclear todo
$ python manage.py sqlclear todo CommandError: App with label todo could not be found. Are you sure your INSTALLED_APPS setting is correct?
因此,我在settings.py中的INSTALLED_APPS中添加了“ todo”,然后python manage.py sqlclear todo再次运行,导致此错误:
$ python manage.py sqlclear todo - NameError: name 'admin' is not defined
reset已被flush Django 1.5 取代,请参阅:
reset
flush
python manage.py help flush