TypeError at /regist/
list indices must be integers, not str
Request Method: | POST |
---|---|
Request URL: | http://127.0.0.1:8000/regist/ |
Django Version: | 1.6.1 |
Exception Type: | TypeError |
Exception Value: | list indices must be integers, not str |
Exception Location: | C:\Users\quan\Desktop\djangoProject\myblog\web\web\blog\views.py in userRegist, line 57 |
Python Executable: | C:\Python27\python.exe |
Python Version: | 2.7.6 |
Python Path: | ['C:\\Users\\quan\\Desktop\\djangoProject\\myblog\\web', 'C:\\Python27\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27', 'C:\\Python27\\lib\\site-packages', 'C:\\Python27\\lib\\site-packages\\PIL'] |
Server time: | 星期四, 13 二月 2014 11:25:27 +0800 |
错误原因 views中的验证表单写错了
views
email = regForm.cleaned_data['email']
#获取头像
image = regForm.changed_data['image']
修改过来就正确了