Cloud Computing Course

23 rader
706 B

4 år sedan
  1. from flask import render_template,request
  2. from app import app
  3. from .form import Book
  4. import os
  5. import _thread
  6. @app.route('/')
  7. @app.route('/index')
  8. def index():
  9. return render_template('login.html',form=Book())
  10. @app.route('/confirmed', methods=['get', 'post'])
  11. def BookTest():
  12. form = Book()
  13. if request.method == 'POST':
  14. if form.validate_on_submit():
  15. username = form.username.data
  16. password = form.password.data
  17. email = form.email.data
  18. area = form.area.data
  19. cmd='python3 auto.py '+username+' '+password+' '+email+' '+area
  20. _thread.start_new_thread(os.system,(cmd,))
  21. return render_template('success.html')