1

Django 1.41 で Web アプリを構築し、展開に GAE を使用しています。とても良いので、登録時にユーザーにメールを送信し、ユーザーがパスワードを変更できるようにする場合を除いて、すべてが機能しているようです。NotimplementedError と No exception provided が表示されます。以下に完全なスタックを貼り付けました。私は間違った方法で何をしている可能性がありますか?

完全な Django トレースバック

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: 

提案されたカスタム バックエンドを使用した後、「展開するには複数の値が必要です」というエラーが表示されました

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
4

2 に答える 2

3

Django のメール バックエンドは、App Engine のメール API では機能しません。

他の人がそれを行うものを作成しました

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

于 2012-11-30T16:02:44.053 に答える
1

開発目的のためだけの別の回避策は次のとおりです。

email_message.extra_headers['message-id'] = 'mydummymessageid'

これにより、Django が作成しようとするのを防ぐことができるため、GAE 開発環境でgethostbyaddrを呼び出そうとすることはありません。

于 2013-04-04T10:33:49.127 に答える