fetch('https://jsonplaceholder.typicode.com/users')
.then(res => res.json())
.then(res => res.map(user => user.username))
.then(userNames => console.log(userNames));
user = db.session.query(Users).filter(Users.username == form.username.data).first()
print('user_id', user.id)
from flask import send_file
@app.route('/text', methods=['POST'])
def caption():
return send_file('file.txt' , as_attachment=True)
if request.method == 'POST':
if not form.validate_on_submit():
print(form.errors.items())
my_choice = SelectField(u'Test', choices=[('0', '0'), ('1', '1')])
language = SelectField(u'Programming Language', choices=[('cpp', 'C++'), ('py', 'Python'), ('text', 'Plain Text')])
submit = SubmitField('Выбрать')