Add admin template

master
Neslihan 4 years ago
parent bf105f7048
commit 9de55402f9
  1. 4
      app/routes.py
  2. 5
      app/templates/admin.html

@ -31,7 +31,7 @@ def register():
@app.route('/login', methods=['GET', 'POST'])
def login():
if current_user.is_authenticated:
return redirect(url_for('index'))
return redirect(url_for('admin'))
form = LoginForm()
if form.validate_on_submit():
user = User.query.filter_by(username=form.username.data).first()
@ -46,7 +46,7 @@ def login():
@app.route('/admin')
@login_required
def admin():
return "Hello, World!"
return render_template('admin.html')
@app.route('/logout')

@ -0,0 +1,5 @@
{% extends "base.html" %}
{% block content %}
<h1>Hi, {{ current_user.username }}!</h1>
{% endblock %}
Loading…
Cancel
Save