-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapp.py
More file actions
30 lines (24 loc) · 881 Bytes
/
app.py
File metadata and controls
30 lines (24 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from flask import Flask, render_template, request, redirect, url_for, session
from config import Config
from database import init_app
from models import get_taches, get_projets
from routes.projet_routes import projet_bp
from routes.tache_routes import tache_bp
app = Flask(__name__)
app.config.from_object(Config)
app.secret_key = 'votre_cle_secrete' # Pour la gestion de session
# Enregistrement des blueprints
app.register_blueprint(projet_bp)
app.register_blueprint(tache_bp)
# Initialisation de la base
init_app(app)
@app.route('/set_style/<style>')
def set_style(style):
session['style'] = style
return redirect(request.referrer or url_for('index'))
@app.route('/')
def index():
style = session.get('style', 'nostyle')
return render_template('index.html', taches=get_taches(), projets=get_projets(), style=style)
if __name__ == '__main__':
app.run()