Guest User

Untitled

a guest
Jul 30th, 2018
558
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. appengine sending mail getting no error for hardcoded emails, but errors when using the data sent in form
  2. def post_data(request):
  3. logging.info(request.POST)
  4. frm_name = request.POST['name'] frm_mail = request.POST['email']
  5. frm = frm_name + " <" + frm_mail + ">"
  6. frm = '"%s"' % frm #above two lines # done to produce a format like "Name <name@mail.com>"
  7. sub = request.POST['subject']
  8. cmnt = request.POST['comment']
  9. extra = str(frm + sub + cmnt)
  10. logging.info(frm)
  11. a = mail.send_mail(sender=frm,
  12. to="Albert Johnson <du***@gmail.com>",
  13. subject=sub,
  14. body=cmnt)
  15. logging.info(a)
  16. return http.HttpResponse("1")
  17.  
  18. <class 'django.core.exceptions.ImproperlyConfigured'>: You haven't set the DATABASE_ENGINE setting yet.
  19.  
  20. def post_data(request):
  21. logging.info(request.POST)
  22. sub = request.POST['subject']
  23. cmnt = request.POST['comment']
  24. a = mail.send_mail(sender="Albert Johnson <du***@gmail.com>",
  25. to="Albert Johnson <du***@gmail.com>",
  26. subject=sub,
  27. body=cmnt)
  28. logging.info(a)
  29. return http.HttpResponse("1")
  30.  
  31. Traceback (most recent call last):
  32. File "/base/data/home/apps/s~takemailer/1.357442066172211834/django_bootstrap.py", line 65, in <module>
  33. main()
  34. File "/base/data/home/apps/s~takemailer/1.357442066172211834/django_bootstrap.py", line 62, in main
  35. util.run_wsgi_app(application)
  36. File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 98, in run_wsgi_app
  37. run_bare_wsgi_app(add_wsgi_middleware(application))
  38. File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 116, in run_bare_wsgi_app
  39. result = application(env, _start_response)
  40. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/wsgi.py", line 189, in __call__
  41. response = self.get_response(request)
  42. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/base.py", line 115, in get_response
  43. receivers = dispatcher.send(signal=signals.got_request_exception)
  44. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/dispatch/dispatcher.py", line 360, in send
  45. **named
  46. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/dispatch/robustapply.py", line 47, in robustApply
  47. return receiver(*arguments, **named)
  48. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/__init__.py", line 47, in _rollback_on_exception
  49. transaction.rollback_unless_managed()
  50. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/transaction.py", line 145, in rollback_unless_managed
  51. connection._rollback()
  52. File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/backends/dummy/base.py", line 13, in complain
  53. raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
Add Comment
Please, Sign In to add comment