Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/login', methods=['GET', 'POST'])
- def login():
- form = LoginForm()
- name=form.name.data
- if form.validate_on_submit():
- user = User.query.filter_by(username=form.username.data).first()
- if user:
- if user.password == form.password.data:
- login_user(user, remember=form.remember.data)
- session['logged_in'] = True
- return redirect(url_for('dashboard', name=name))
- return '<h1>Invalid username or password</h1>'
- #return '<h1>' + form.username.data + ' ' + form.password.data + '</h1>'
- return render_template('login.html', form=form)
- @app.route('/dashboard', methods=['GET', 'POST'])
- @login_required
- def dashboard():
- name=request.args.get('name')
- return render_template('dashboard.html',name=name)
- <section id="home" style="background: url('../static/images/rate25.jpg');background-attachment: fixed;background-size: cover;background-repeat: no-repeat;background-position: center;">
- <div class="container-fluid con" align="center">
- <div class="row" align="center">
- <div class="col-sm-2"></div>
- <div class="col-sm-8">
- <h1 class="h1" style="font-weight: 500;text-transform: unset;">Hi {{name}}, Welcome to Ratingspro</h1></div>
- <div class="col-sm-2"></div>
- </div>
- </div>
- </section>
Add Comment
Please, Sign In to add comment