我刚刚升级到 Django 1.4 并收到以下错误:
'WSGIRequest' object has no attribute 'SUCCESS'
追溯:
File "/Users/nb/Desktop/myenv2/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
111. response = callback(request, *callback_args, **callback_kwargs)
File "/Users/nb/Desktop/spicestore/apps/account/views.py" in login
87. messages.add_message(request.SUCCESS,
Exception Type: AttributeError at /account/login/
Exception Value: 'WSGIRequest' object has no attribute 'SUCCESS'
有谁知道可能是什么原因造成的?
这是views.py中的实际代码:
messages.add_message(request.SUCCESS,
ugettext(u"Successfully logged in as %(user)s.") % {
"user": user_display(form.user)
}