Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from flask import Flask, render_template, request, jsonify
- app = Flask(__name__)
- @app.route('/')
- def index():
- return render_template('form.html')
- @app.route('/process', methods=['POST'])
- def process():
- name = request.form['name']
- if name:
- return jsonify({'name' : 'Adres pocztowy prawidłowy!'})
- return jsonify({'error' : 'Kod pocztowy jest nieprawidłowy!'})
- if __name__ == '__main__':
- app.run(debug=True)
Advertisement
Add Comment
Please, Sign In to add comment