R
R
rkocoan2018-12-04 13:36:44
Python
rkocoan, 2018-12-04 13:36:44

ReCAPTCHA check in python?

Hello.
For the first time I came across Python, guys, tell me how to connect the form with the reCAPTCHA check.
I will be grateful

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", "[email protected]"),
                recipients=["[email protected]"])
        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)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
latush, 2018-12-04
@latush

https://github.com/praekelt/django-recaptcha - not?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question