You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
570 B
Python
22 lines
570 B
Python
import typing as t
|
|
|
|
import werkzeug
|
|
from flask import render_template
|
|
|
|
from .app import app
|
|
from .cmd import db_cli
|
|
from .routes import main
|
|
|
|
app.register_blueprint(main)
|
|
app.cli.add_command(db_cli)
|
|
|
|
|
|
@app.errorhandler(404)
|
|
def page_not_found(e: werkzeug.exceptions.HTTPException) -> t.Tuple[t.Text, int]:
|
|
return render_template("404.html", title="Page non trouvée"), 404
|
|
|
|
|
|
@app.errorhandler(500)
|
|
def internal_server_error(e: werkzeug.exceptions.HTTPException) -> t.Tuple[t.Text, int]:
|
|
return render_template("500.html", title="Erreur interne du serveur"), 500
|