How to associate a form with reCAPTCHA verification?

mail = Mail(app); @app.route('/order', methods=['GET', 'POST']) def show_orders(): form = OrderForm(request.form) if request.method == 'POST' and form.validate(): order = Order() order.name = form.name.data order.email = form.email.data order.organization_name = form.organization_name.data order.contact_phone = form.contact_phone.data order.text = form.text.data db.session.merge(order) @copy_current_request_context def send_message(order): msg = Message("Новый заказ на site.ru", sender=("site", "mail@mail.ru"), recipients=["mail@mail.ru"]) msg.body = u"Новый заказ на mail.su: " mail.send(msg) sender = threading.Thread(name='mail_sender', target=send_message, args=(order,)) sender.start() db.session.commit() return render_template('order.html', form=OrderForm(), thanx=True) return render_template('order.html', form=form) 
  • The code you give does not apply to Django. - Sergey Gornostaev
  • It looks like a flask - gil9red

0