Answer the question
In order to leave comments, you need to log in
What does expected string or Unicode object, long found mean?
Site on Flask, when authorizing (Flask-Login) an error appears in the logs:
TypeError: expected string or Unicode object, long found
from flask.ext.login import login_user, logout_user, current_user, login_required
def main():
form = LoginForm()
if form.validate_on_submit():
username = request.form['username']
password = request.form['password']
user = User.query.filter_by(username=username, password=password).first()
if user is None:
flash('Login or Password is invalid', 'error')
return redirect("/")
login_user(user)
return redirect("/")
news = News.query.order_by(News.putdate.desc()).limit(3)
return render_template("main/main.html",
news= news,
form = form)
Answer the question
In order to leave comments, you need to log in
The problem was solved by removing flask, sqlalchemy, flask-sqlalchemy and installing specific versions (not the latest) flask==0.9, sqlalchemy==0.7.9, flask-sqlalchemy==0.16
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question