SaveText.Ru

Без имени
  1. # -
  2. # -
  3. # -
  4.  
  5. from flask import Flask, render_template, request
  6.  
  7. app=Flask(__name__)
  8.  
  9. @app.route('/', methods=['GET', 'POST'])
  10. def index():
  11.     if request.method == 'POST':
  12.         name = (request.form['name'])
  13.         name = (request.form['email'])
  14.         name = (request.form['password'])
  15.         name = (request.form['password_check'])
  16.        
  17.         return 'Form was sent'
  18.     return render_template('index.html')
  19.  
  20. @app.route('/users/<name>')
  21. def user_page(name):
  22.     return render_template('user.html', name=name.titile())
  23.  
  24.  
  25. # @app.route('/users/milena')
  26. # def user_milena():
  27. #     return 'hi, milena'
  28.  
  29.  
  30.  
  31. app.run(debug=True)

Share with your friends:

Print