问答详情
源自:-

在HelloWorld中,页面中出现TypeError错误

__init__() takes 1 positional argument but 2 were given
Request Method:GET
Request URL:http://127.0.0.1:8000/bolg/hello_world
Django Version:2.0
Exception Type:TypeError
Exception Value:
__init__() takes 1 positional argument but 2 were given
Exception Location:/Users/sadocument/django_project/django_introduction/bolg/views.py in hello_world, line 9
Python Executable:/Users/sadocument/opt/anaconda3/bin/python
Python Version:3.7.6
Python Path:
['/Users/sadocument/django_project/django_introduction',
 '/Users/sadocument/opt/anaconda3/lib/python37.zip',
 '/Users/sadocument/opt/anaconda3/lib/python3.7',
 '/Users/sadocument/opt/anaconda3/lib/python3.7/lib-dynload',
 '/Users/sadocument/opt/anaconda3/lib/python3.7/site-packages',
 '/Users/sadocument/opt/anaconda3/lib/python3.7/site-packages/aeosa']


提问者:慕粉3944158 2020-12-19 22:51

个回答

  • lgsp_lucifer1225
    2021-01-07 16:20:01
    已采纳

    这个文件bolg/views.py代码贴出来,报错提示第九行。错误提示,方法接收一个参数,但是你传了两个参数。