Skip to content

Commit

Permalink
add flask_login draft - Update main_flask.py
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPlacentino authored Dec 11, 2023
1 parent 4eae916 commit 7953c22
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions main_flask.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
from flask import Flask, render_template
from flask_login import LoginManager # TODO: user session management
from user import User # TODO:

app = Flask(__name__)


app = Flask(__name__)
login_manager = LoginManager()
login_manager.init_app(app)

@app.route("/")
def home():
return render_template("home.html", user=user)


@app.route("/discord-login")
@login_required
def discord_login():
if user.site_lang = "en":
return render_template("discord-login_en.html"; user=user)
else:
return render_template("discord-login_fr.html", user=user)


@app.route("/user")
@app.route("/user")
@login_required
def user():
if user.site_lang = "en":
return render_template("user_en.html", user=user)
Expand Down

0 comments on commit 7953c22

Please sign in to comment.