新手求救

进行用户信息修改、删除的时候

OperationalError at / no such column: blog_article.user_id Request Method: GET Request URL: http://127.0.0.1:8000/ Django Version: 3.0.3 Exception Type: OperationalError Exception Value:
no such column: blog_article.user_id Exception Location: E:\pythonProject\MyBlog\myblogenv\lib\site-packages\django\db\backends\sqlite3\base.py in execute, line 396 Python Executable: E:\pythonProject\MyBlog\myblogenv\Scripts\python.exe Python Version: 3.8.0 Python Path:
['E:\pythonProject\MyBlog', 'E:\pythonProject\MyBlog', 'D:\PyCharm 2019.3.3\plugins\python\helpers\pycharm_display', 'C:\Users\logcat\AppData\Local\Programs\Python\Python38\python38.zip', 'C:\Users\logcat\AppData\Local\Programs\Python\Python38\DLLs', 'C:\Users\logcat\AppData\Local\Programs\Python\Python38\lib', 'C:\Users\logcat\AppData\Local\Programs\Python\Python38', 'E:\pythonProject\MyBlog\myblogenv', 'E:\pythonProject\MyBlog\myblogenv\lib\site-packages', 'E:\pythonProject\MyBlog\myblogenv\lib\site-packages\setuptools-40.8.0-py3.8.egg', 'D:\PyCharm 2019.3.3\plugins\python\helpers\pycharm_matplotlib_backend'] Server time: 星期六, 22 二月 2020 00:11:32 +0800

评论 1

  • no such column: blog_article.user_id 按字面意思理解,应该是模型里缺少 user_id 看一下模型,或者运行一下 python3 manage.py makemigrations python3 manage.py migrate