1
我有一個非常簡單的登錄表單:Django的形式清理數據「值過多解壓」的錯誤
class LoginForm(forms.Form):
username = forms.CharField(max_length=100,required = True)
password = forms.CharField(widget = forms.PasswordInput(),max_length=100,required = True)
我使用它下面的意見的方式:
def login(request):
msg = []
form = LoginForm()
if request.method == 'POST':
form = LoginForm(request.POST)
if form.is_valid():
username = form.cleaned_data['username']
password = form.cleaned_data['password']
user = authenticate(username = username, password = password)
我得到的錯誤太多值解包。我究竟做錯了什麼 ?如果您需要更多信息,請評論。
哪一行給出錯誤? – Don