From 9de55402f90d3e589ad2bae580bdb8e7dd1b28dd Mon Sep 17 00:00:00 2001 From: Neslihan Date: Sun, 28 Feb 2021 22:35:32 +0300 Subject: [PATCH] Add admin template --- app/routes.py | 4 ++-- app/templates/admin.html | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 app/templates/admin.html diff --git a/app/routes.py b/app/routes.py index 8593cfa..d1af06f 100644 --- a/app/routes.py +++ b/app/routes.py @@ -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') diff --git a/app/templates/admin.html b/app/templates/admin.html new file mode 100644 index 0000000..7e63a37 --- /dev/null +++ b/app/templates/admin.html @@ -0,0 +1,5 @@ +{% extends "base.html" %} + +{% block content %} +

Hi, {{ current_user.username }}!

+{% endblock %} \ No newline at end of file