点击发表文章时一直报这个

来源:7-5 用户发表文章与保存草稿

JERRY

2020-03-04

TypeError at /articles/write-new-article/
init() got an unexpected keyword argument ‘instance’
Request Method: GET
Request URL: http://106.12.72.181:8000/articles/write-new-article/
Django Version: 2.1.7
Exception Type: TypeError
Exception Value:
init() got an unexpected keyword argument ‘instance’
Exception Location: /root/.local/share/virtualenvs/dev-zanhu-8G1gZrYC/lib/python3.7/site-packages/django/views/generic/edit.py in get_form, line 33
Python Executable: /root/.local/share/virtualenvs/dev-zanhu-8G1gZrYC/bin/python
Python Version: 3.7.6
Python Path:
[’/root/dev-zanhu/zanhu’,
’/root/dev-zanhu/zanhu’,
’/root/dev-zanhu/zanhu/zanhu’,
’/root/.pycharm_helpers/pycharm_display’,
’/usr/local/python/lib/python37.zip’,
’/usr/local/python/lib/python3.7’,
’/usr/local/python/lib/python3.7/lib-dynload’,
’/root/.local/share/virtualenvs/dev-zanhu-8G1gZrYC/lib/python3.7/site-packages’,
’/root/.pycharm_helpers/pycharm_matplotlib_backend’,
’/root/dev-zanhu/zanhu/zanhu’,
’/root/dev-zanhu/zanhu’,
’/root/dev-zanhu/zanhu/zanhu’]
Server time: 星期三, 4 三月 2020 17:52:31 +0800

写回答

1回答

Jack

2020-03-06

init() got an unexpected keyword argument ‘instance’

能否把发表文章部分的代码截图一下, views.py里的

0
0

Django高级实战 开发企业级问答网站

融合Django高级用法/算法/设计模式/TestCase测试/云计算打造项目

900 学习 · 756 问题

查看课程