Basic architecture

This commit is contained in:
Ulbert committed 2026-10-08 16:17:17 +02:00
1 parent f787232548
commit ad1dcfb1d7
7 files changed
+66

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
from flask import Flask
from .routes.main import main_bp
def create_app():
app = Flask(__name__, instance_relative_config=True)
# Charge la config par défaut
app.config.from_object("app.config.Config")
# Charge la config sensible (instance/config.py)
app.config.from_pyfile("config.py", silent=True)
# Enregistre les blueprints
app.register_blueprint(main_bp)
return app
+3
View File
@@ -0,0 +1,3 @@
class Config:
DEBUG = True
SECRET_KEY = "jaimelespainsauchocolat"
+7
View File
@@ -0,0 +1,7 @@
from flask import Blueprint, render_template
main_bp = Blueprint("main", __name__)
@main_bp.route("/")
def index():
return render_template("index.html", title="SnowField")
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>{% block title %}SnowField{% endblock %}</title>
<!-- Exemple CSS -->
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
</head>
<body>
<main>
{% block content %}
{% endblock %}
</main>
<footer>
<p>© 2026 SnowField</p>
</footer>
</body>
</html>
+8
View File
@@ -0,0 +1,8 @@
{% extends "base.html" %}
{% block title %}Accueil - SnowField{% endblock %}
{% block content %}
<h2>Bienvenue sur SnowField</h2>
<p>Ceci est la page d'accueil.</p>
{% endblock %}