我正在尝试为用户注册创建一个应用程序,每当我尝试在数据库中插入值时,它都会显示错误:- TypeError: object() 不接受任何参数。
视图.py
@app.route('/join/' , methods=['GET','POST'])
def join():
if request.method == 'POST' and request.form['username']:
try:
user = User.select().where(User.username==request.form['username']).get()
flash('That username is already taken')
except:
#user = User.select().where(User.username==request.form['username']).get()
user = User(username = request.form['username']) #, email = request.form['email'] , password = request.form['password'] )
# user.set_password(request.form['password'] )
user.save()
auth.login_user(user)
return 'dua me yaad rakhna'
# return render_template('home')
# else:
# return 'HAAN G DEKHYa fer'
return render_template("join.html")