23 lines
640 B
Python
23 lines
640 B
Python
|
from flask import Blueprint, render_template, redirect, url_for
|
||
|
from flask_login import current_user
|
||
|
|
||
|
# Create a blueprint for main routes
|
||
|
main_bp = Blueprint("main", __name__)
|
||
|
|
||
|
|
||
|
@main_bp.route("/")
|
||
|
def index():
|
||
|
"""Render the homepage."""
|
||
|
if current_user.is_authenticated:
|
||
|
# If user is logged in, we could redirect to a dashboard or just show the main page
|
||
|
return render_template("index.html")
|
||
|
else:
|
||
|
# For non-authenticated users, show the public homepage
|
||
|
return render_template("index.html")
|
||
|
|
||
|
|
||
|
@main_bp.route("/about")
|
||
|
def about():
|
||
|
"""About page."""
|
||
|
return render_template("about.html")
|