保存网络摄像头错误所显示的快照显示“不正确的填充”

时间:2015-10-26 14:02:05

标签: python django

当我删除图片并尝试保存配置文件时,它会向我显示错误“incorect padding”

我的代码是

Models.py

import webcam.admin
from webcam import widgets
from webcam.fields import CameraField
picture=CameraField('Webcam_Image', format='jpeg', null=True, blank=True, upload_to='pictures')

admin.py

from webcam import widgets
from webcam.fields import CameraField
FORMFIELD_FOR_DBFIELD_DEFAULTS[CameraField] = {'widget': widgets.CameraWidget}

错误

Incorrect padding
Request Method: POST
Request URL:    http://127.0.0.1:8000/admin/account/account/8/
Django Version: 1.8.4
Exception Type: Error
Exception Value:    
Incorrect padding
Exception Location: /usr/lib/python2.7/base64.py in decodestring, line 321
Python Executable:  /home/cpverma/work/school/env/bin/python
Python Version: 2.7.6
Python Path:    
['/home/cpverma/work/cpverma/crushernew',
 '/home/cpverma/work/school/env/lib/python2.7',
 '/home/cpverma/work/school/env/lib/python2.7/plat-x86_64-linux-gnu',
 '/home/cpverma/work/school/env/lib/python2.7/lib-tk',
 '/home/cpverma/work/school/env/lib/python2.7/lib-old',
 '/home/cpverma/work/school/env/lib/python2.7/lib-dynload',
 '/usr/lib/python2.7',
 '/usr/lib/python2.7/plat-x86_64-linux-gnu',
 '/usr/lib/python2.7/lib-tk',
 '/home/cpverma/work/school/env/local/lib/python2.7/site-packages']
Server time:    Wed, 28 Oct 2015 22:06:04 +0000

1 个答案:

答案 0 :(得分:0)

首先尝试使用库提供的演示,然后查看不同的here.