首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Django NotimplementedError on GAE

Django NotimplementedError on GAE
EN

Stack Overflow用户
提问于 2012-11-30 19:28:04
回答 2查看 625关注 0票数 1

我正在使用Django 1.41构建我的web应用程序,并使用GAE进行部署。所以一切似乎都很好,除了我尝试在注册时发送电子邮件给用户,并允许用户更改他们的密码。我得到了NotimplementedError,并且没有提供异常。我已经在下面粘贴了完整的堆栈。我可能做错了什么呢?

完整的Django回溯

代码语言:javascript
复制
Environment:


Request Method: POST
Request URL: http://1.ngloancalc.appspot.com/register/

Django Version: 1.4.1
Python Version: 2.7.2
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'carloan',
 'registeredmember',
 'contact')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/base/data/home/apps/s~ngloancalc/1.363534897067998089/registeredmember/views.py" in userregistration
  36.             connection.open()
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/mail/backends/smtp.py" in open
  48.                                            local_hostname=DNS_NAME.get_fqdn())
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/mail/utils.py" in get_fqdn
  16.             self._fqdn = socket.getfqdn()
File "/base/python27_runtime/python27_dist/lib/python2.7/socket.py" in getfqdn
  129.         hostname, aliases, ipaddrs = gethostbyaddr(name)
File "/base/python27_runtime/python27_lib/versions/1/google/appengine/api/remote_socket/_remote_socket.py" in gethostbyaddr
  313.   raise NotImplementedError()

Exception Type: NotImplementedError at /register/
Exception Value: 

在使用了建议的自定义后端之后,我得到了错误消息'need more one value to unpack‘

代码语言:javascript
复制
Environment:


Request Method: POST
Request URL: http://www.ngloancalc.appspot.com/resetpassword/

Django Version: 1.4.1
Python Version: 2.7.2
Installed Applications:
('django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'django.contrib.messages',
 'django.contrib.staticfiles',
 'django.contrib.admin',
 'django.contrib.admindocs',
 'carloan',
 'registeredmember',
 'contact')
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')


Traceback:
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/utils/decorators.py" in _wrapped_view
  91.                     response = view_func(request, *args, **kwargs)
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/contrib/auth/views.py" in password_reset
  160.             form.save(**opts)
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/contrib/auth/forms.py" in save
  242.             send_mail(subject, email, from_email, [user.email])
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/mail/__init__.py" in send_mail
  59.                                     fail_silently=fail_silently)
File "/base/python27_runtime/python27_lib/versions/third_party/django-1.4/django/core/mail/__init__.py" in get_connection
  31.         mod_name, klass_name = path.rsplit('.', 1)

Exception Type: ValueError at /resetpassword/
Exception Value: need more than 1 value to unpack
EN

回答 2

Stack Overflow用户

发布于 2012-12-01 00:02:44

Django的电子邮件后端不能与App Engine的电子邮件API一起工作。

不过,其他人已经创建了一个

https://bitbucket.org/andialbrecht/appengine_emailbackends/overview

票数 3
EN

Stack Overflow用户

发布于 2013-04-04 18:33:49

另一种仅用于开发目的的解决方法是:

代码语言:javascript
复制
email_message.extra_headers['message-id'] = 'mydummymessageid'

这可以防止Django尝试创建一个GAE开发环境,因此永远不会尝试调用GAE开发环境中的gethostbyaddr

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13644368

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档