Django Contact Form Mail错误:协议请求不支持地址族 [英] Django Contact Form Mail Error :Address family not supported by protocol Request

查看:57
本文介绍了Django Contact Form Mail错误:协议请求不支持地址族的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站中使用Django作为联系表格.提交

I am using Django for contact form in my website . I get problem when submit

[Errno 97] Address family not supported by protocol
Request Method: POST
Request URL:    http://site.com/accept
Django Version: 1.3.1
Exception Type: error
Exception Value:    
[Errno 97] Address family not supported by protocol
Exception Location: /usr/lib64/python2.6/socket.py in create_connection, line 567
Python Executable:  /usr/local/bin/python
Python Version: 2.6.6

这是我的设置:

EMAIL_HOST = 'smtp.gmail.com'

EMAIL_PORT = 587

EMAIL_HOST_USER = 'myemail@gmail.com'

EMAIL_HOST_PASSWORD = 'mypassword'

EMAIL_USE_TLS = True

推荐答案

似乎这与您的设置无关,但与服务器配置无关.某些服务会与IPv6混淆(例如此答案).您应该尝试通过侦听IPv4地址来运行Web服务器和SMTP服务器.

It seems this has nothing to do with your settings, but with your server configuration. Some services get confused with IPv6 (like in this answer). You should try to run either your web server and SMTP server by listening to an IPv4 address.

2014年,由于库和框架已更新并且应用于操作IPv6地址,因此该问题应得到解决.

In 2014, the problem should be resolved, since libraries and frameworks have been updated and should be used to manipulate IPv6 addresses.

这篇关于Django Contact Form Mail错误:协议请求不支持地址族的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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