我正在使用CentOS和AWS ENV。之前它很好。在创建新实例并部署相同的代码之后。现在我收到以下错误: AttributeError:类型对象'SESConnection'没有属性'DefaultHost',
boto==2.24.0
django-autofixture==0.2.5
django-debug-toolbar==0.9.4
django-extensions==0.6
django-formwizard==1.0
django-model-utils==1.0.0
django-pylibmc-sasl==0.2.4
django-ses==0.2
django-uni-form==0.9.0
python 2.6.6
django 1.3.1
mod_wsgi (pid=1137): Exception occurred processing WSGI script '/var/www/stacks/django/myproject/config/apache/django.wsgi'., referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
Traceback (most recent call last):, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 272, in __call__, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
response = self.get_response(request), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 169, in get_response, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
response = self.handle_uncaught_exception(request, resolver, sys.exc_info()), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 209, in handle_uncaught_exception, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
'request':request, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1082, in error, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self._log(ERROR, msg, args, **kwargs), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1173, in _log, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.handle(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1183, in handle, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.callHandlers(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1220, in callHandlers, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
hdlr.handle(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 679, in handle, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.emit(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/utils/log.py", line 101, in emit, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
html_message=html_message), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/__init__.py", line 96, in mail_admins, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
mail.send(fail_silently=fail_silently), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/message.py", line 251, in send, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
return self.get_connection(fail_silently).send_messages([self]), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/message.py", line 211, in get_connection, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.connection = get_connection(fail_silently=fail_silently), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/__init__.py", line 41, in get_connection, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
return klass(fail_silently=fail_silently, **kwds), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django_ses/__init__.py", line 22, in __init__, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
SESConnection.DefaultHost), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
AttributeError: type object 'SESConnection' has no attribute 'DefaultHost', referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
mod_wsgi (pid=1132): Exception occurred processing WSGI script '/var/www/stacks/django/myproject/config/apache/django.wsgi'., referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
Traceback (most recent call last):, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/wsgi.py", line 272, in __call__, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
response = self.get_response(request), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 169, in get_response, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
response = self.handle_uncaught_exception(request, resolver, sys.exc_info()), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py", line 209, in handle_uncaught_exception, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
'request':request, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1082, in error, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self._log(ERROR, msg, args, **kwargs), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1173, in _log, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.handle(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1183, in handle, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.callHandlers(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 1220, in callHandlers, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
hdlr.handle(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib64/python2.6/logging/__init__.py", line 679, in handle, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.emit(record), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/utils/log.py", line 101, in emit, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
html_message=html_message), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/__init__.py", line 96, in mail_admins, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
mail.send(fail_silently=fail_silently), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/message.py", line 251, in send, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
return self.get_connection(fail_silently).send_messages([self]), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/message.py", line 211, in get_connection, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
self.connection = get_connection(fail_silently=fail_silently), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django/core/mail/__init__.py", line 41, in get_connection, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
return klass(fail_silently=fail_silently, **kwds), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
File "/usr/lib/python2.6/site-packages/django_ses/__init__.py", line 22, in __init__, referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
SESConnection.DefaultHost), referer: http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
AttributeError:类型对象'SESConnection'没有属性'DefaultHost',referer:http://ec2-24-20-18-576.compute-1.amazonaws.com/app_new/mail/
答案 0 :(得分:1)
可能是配置问题。您当前实例的另一种可能性是没有SES权限。我不太确定这是正确的答案。但你可以尝试一下。 @使用SES功能创建工作实例的新AMI图像。并从该AMI号启动新实例。并检查它。
另一种可能性是:
MYSQL和APACHE服务器应该处于运行模式。
对于MYSQL服务器:
/etc/init.d/mysqld status
如果没有启动则运行
/etc/init.d/mysqld start
对于Centos上的Apache服务器:
/etc/init.d/httpd status
如果没有启动则运行
/etc/init.d/httpd start