Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- appengine sending mail getting no error for hardcoded emails, but errors when using the data sent in form
- def post_data(request):
- logging.info(request.POST)
- frm_name = request.POST['name'] frm_mail = request.POST['email']
- frm = frm_name + " <" + frm_mail + ">"
- frm = '"%s"' % frm #above two lines # done to produce a format like "Name <name@mail.com>"
- sub = request.POST['subject']
- cmnt = request.POST['comment']
- extra = str(frm + sub + cmnt)
- logging.info(frm)
- a = mail.send_mail(sender=frm,
- to="Albert Johnson <du***@gmail.com>",
- subject=sub,
- body=cmnt)
- logging.info(a)
- return http.HttpResponse("1")
- <class 'django.core.exceptions.ImproperlyConfigured'>: You haven't set the DATABASE_ENGINE setting yet.
- def post_data(request):
- logging.info(request.POST)
- sub = request.POST['subject']
- cmnt = request.POST['comment']
- a = mail.send_mail(sender="Albert Johnson <du***@gmail.com>",
- to="Albert Johnson <du***@gmail.com>",
- subject=sub,
- body=cmnt)
- logging.info(a)
- return http.HttpResponse("1")
- Traceback (most recent call last):
- File "/base/data/home/apps/s~takemailer/1.357442066172211834/django_bootstrap.py", line 65, in <module>
- main()
- File "/base/data/home/apps/s~takemailer/1.357442066172211834/django_bootstrap.py", line 62, in main
- util.run_wsgi_app(application)
- File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 98, in run_wsgi_app
- run_bare_wsgi_app(add_wsgi_middleware(application))
- File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/util.py", line 116, in run_bare_wsgi_app
- result = application(env, _start_response)
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/wsgi.py", line 189, in __call__
- response = self.get_response(request)
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/core/handlers/base.py", line 115, in get_response
- receivers = dispatcher.send(signal=signals.got_request_exception)
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/dispatch/dispatcher.py", line 360, in send
- **named
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/dispatch/robustapply.py", line 47, in robustApply
- return receiver(*arguments, **named)
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/__init__.py", line 47, in _rollback_on_exception
- transaction.rollback_unless_managed()
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/transaction.py", line 145, in rollback_unless_managed
- connection._rollback()
- File "/base/python_runtime/python_lib/versions/third_party/django-0.96/django/db/backends/dummy/base.py", line 13, in complain
- raise ImproperlyConfigured, "You haven't set the DATABASE_ENGINE setting yet."
Add Comment
Please, Sign In to add comment