database error no such table django

余生颓废 提交于 2019-12-04 16:23:36

The main difference is that firing manage.py sql myapphere will show the queries used to create the schema for your database, while the ouput of myapp.objects.all() will simply return a list of the entries in that database.

For example, if you had a list of articles, the manage.py sql command would show the myapp properties while myapp.objects.all() will show the instances of myapp in the database.

To further extrapolate your problem, try opening up your DB client and make sure the column names match the ones described in your model. If they don't match up, you might need to drop the table and resync your database (I definitely had that problem).

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!