django-user-accounts和anymail:无效的电子邮件地址格式

时间:2017-02-16 09:42:02

标签: python django python-3.x pinax django-anymail

我已设置django-user-accounts。当我尝试使用密码重置功能并输入有效的电子邮件地址时,我收到以下错误: AnymailInvalidAddress at /account/password_reset/ Invalid email address format '': No email found

这是完整的追溯:

Request Method: POST
Request URL: http://127.0.0.1:8000/account/password_reset/

Django Version: 1.10.5
Python Version: 3.5.2

Traceback:

File "C:\Anaconda3\lib\site-packages\anymail\utils.py" in __init__
  120.                 raise ValueError('No email found')

During handling of the above exception (No email found), another exception 
occurred:

File "C:\Anaconda3\lib\site-packages\django\core\handlers\exception.py" in inner
 39.             response = get_response(request)

File "C:\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _legacy_get_response
 249.             response = self._get_response(request)

File "C:\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  187.                 response = self.process_exception_by_middleware(e, request)

File "C:\Anaconda3\lib\site-packages\django\core\handlers\base.py" in _get_response
  185.                 response = wrapped_callback(request, *callback_args, **callback_kwargs)

File "C:\Anaconda3\lib\site-packages\django\views\generic\base.py" in view
  68.             return self.dispatch(request, *args, **kwargs)

File "C:\Anaconda3\lib\site-packages\django\views\generic\base.py" in dispatch
  88.         return handler(request, *args, **kwargs)

File "C:\Anaconda3\lib\site-packages\django\views\generic\edit.py" in post
  183.             return self.form_valid(form)

File "C:\Anaconda3\lib\site-packages\account\views.py" in form_valid
  582.         self.send_email(form.cleaned_data["email"])

File "C:\Anaconda3\lib\site-packages\account\views.py" in send_email
   608.             hookset.send_password_reset_email([user.email], ctx)

File "C:\Anaconda3\lib\site-packages\account\hooks.py" in send_password_reset_email
  33.         send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, to)

File "C:\Anaconda3\lib\site-packages\django\core\mail\__init__.py" in send_mail
  62.     return mail.send()

File "C:\Anaconda3\lib\site-packages\django\core\mail\message.py" in send
  342.         return self.get_connection(fail_silently).send_messages([self])

File "C:\Anaconda3\lib\site-packages\anymail\backends\base.py" in send_messages
  87.                     sent = self._send(message)

File "C:\Anaconda3\lib\site-packages\anymail\backends\base_requests.py" in _send
 56.         return super(AnymailRequestsBackend, self)._send(message)

File "C:\Anaconda3\lib\site-packages\anymail\backends\base.py" in _send
  116.         payload = self.build_message_payload(message, self.send_defaults)

File "C:\Anaconda3\lib\site-packages\anymail\backends\mailgun.py" in build_message_payload
  28.         return MailgunPayload(message, defaults, self)

File "C:\Anaconda3\lib\site-packages\anymail\backends\mailgun.py" in __init__
 67.         super(MailgunPayload, self).__init__(message, defaults, backend, auth=auth, *args, **kwargs)

File "C:\Anaconda3\lib\site-packages\anymail\backends\base_requests.py" in __init__
 114.         super(RequestsPayload, self).__init__(message, defaults, backend)

File "C:\Anaconda3\lib\site-packages\anymail\backends\base.py" in __init__
  258.                     value = converter(value)

File "C:\Anaconda3\lib\site-packages\anymail\backends\base.py" in parsed_emails
  282.                 for address in addresses]

File "C:\Anaconda3\lib\site-packages\anymail\backends\base.py" in <listcomp>
  282.                 for address in addresses]

File "C:\Anaconda3\lib\site-packages\anymail\utils.py" in __init__
  126.                                         % (address, str(err)))

Exception Type: AnymailInvalidAddress at /account/password_reset/
Exception Value: Invalid email address format '': No email found

发布请求包含有效的电子邮件和CSRF令牌。 Anymail与我网站上的联系表单一起正常工作,所以我相信Anymail设置正确。

我正在使用Django 1.10和Python 3.5

0 个答案:

没有答案