antinote/app/views.py

38 lines
914 B
Python
Raw Normal View History

2023-05-15 03:38:16 +02:00
from flask import Flask, request, session
from flask import render_template, send_from_directory
import os
import sys
from datetime import datetime
sys.path.insert(0, os.path.dirname(__file__))
app = Flask(__name__)
app.config.from_object("config")
app.jinja_env.globals.update({
"year": datetime.now().year,
"menuitems": [
('/', '<i class="fa-solid fa-house-chimney"></i>', 'accueil'),
('/grades/', 'Mes notes', ''),
('/timetable/', 'Emploi du temps', '')
]
})
@app.route("/")
def index():
return render_template("index.html")
@app.route("/grades/")
def grades():
return render_template("grades.html")
@app.route("/timetable/")
def timetable():
return render_template("timetable.html")
@app.route('/favicon.ico')
def favicon():
return send_from_directory(os.path.join(app.root_path, 'static'),
'favicon.ico',mimetype='image/vnd.microsoft.icon')