Vous trouverez la documentation technique à la racine du dépôt Github.
Vous trouverez le manuel d'utilisation à la racine du dépôt Github.
Avant tout, il faut que Python (3.9+) et PostgreSQL soient installés. Si ce n'est pas déjà fait, vous pouvez les installer sur macOS via Homebrew ou directement depuis les sites officiels respectifs.
Cloner le projet :
git clone https://github.com/JeanDevFR/flask-trt
Se rendre dans le répertoire du projet :
cd flask-trt
Créer un environnement virtuel :
# macOS
python3 -m venv venv
# Windows
py -3 -m venv venv
Activer l'environnement virtuel :
# macOS
. venv/bin/activate
# Windows
venv/Scripts/activate
Installer les packages :
pip install -r requirements.txt
Créer un fichier .env à la racine du répertoire avec les informations suivantes :
SECRET_KEY = "secret"
DATABASE_URL = "postgresql://<username>:<password>@localhost:5432/<db-name>"
Modifier les informations suivantes dans le fichier config.py en fonction du serveur smtp que vous utilisez :
# ...
MAIL_SERVER = 'smtp.gmail.com'
MAIL_PORT = 465 # Ou 587 par exemple
# ...
MAIL_USE_TLS = False
MAIL_USE_SSL = True
Ajouter les variables suivantes dans le fichier .env :
# ...
MAIL_USERNAME = 'username'
MAIL_PASSWORD = 'password'
Créer la base de données :
CREATE DATABASE <db-name>;
Créer les tables :
cd flask-trt
flask db upgrade
Lancer l'application :
flask run
Créer un administrateur :
# Un seul administrateur peut être créé. Conservez-bien son mot de passe.
http://localhost:5000/admin/create/administrator