Django allauth示例[Errno 61]连接被拒绝 [英] Django allauth example [Errno 61] Connection refused

查看:296
本文介绍了Django allauth示例[Errno 61]连接被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行django allauth示例并尝试发送电子邮件时,我有以下错误:

 文件/系统/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py,第571行,在create_connection 
raise err
错误:[Errno 61]连接拒绝

在OS X 10.9.1

解决方案

从allauth文档:


当我注册时遇到连接错误(连接拒绝等)



您可能没有在正在开发的
机器上运行电子邮件(SMTP)服务器。因此,allauth无法发送
验证邮件。



您可以通过将以下行添加到settings.py来解决此问题:



EMAIL_BACKEND ='django.core.mail.backends.console.EmailBackend'此
将避免使用SMTP服务器,因为电子邮件将打印到
安慰。有关详细信息,请参阅:





I have the following error when I run django allauth example and it tries to send an email:

File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/socket.py", line 571, in create_connection
raise err
error: [Errno 61] Connection refused

Under OS X 10.9.1

From allauth documentation:

When I sign up I run into connectivity errors (connection refused et al)

You probably have not got an e-mail (SMTP) server running on the machine you are developing on. Therefore, allauth is unable to send verification mails.

You can work around this by adding the following line to settings.py:

EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' This will avoid the need for an SMTP server as e-mails will be printed to the console. For more information, please refer to:

https://docs.djangoproject.com/en/dev/ref/settings/#email-host

这篇关于Django allauth示例[Errno 61]连接被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆