IntraRez

Application Flask de l’Intranet de la Rez.

Exigences

  • Python : Probablement >= 3.10 à terme, pour l’instant >= 3.8 suffit ;
  • Autres packages Linux : mysql-server postfix git, plus pour le déploiement : supervisor nginx ;
  • Packages Python : Voir requirements.txt, plus pour le déploiement : gunicorn pymysql cryptography ;
  • Pour le déploiement : un utilisateur Linux intrarez dédié.

Installation

Je reprends pour l’essentiel le déploiement conseillé dans le tutoriel : https://blog.miguelgrinberg.com/post/the-flask-mega-tutorial-part-xvii-deployment-on-linux

  • Installer l’application :

    cd /home/intrarez
    git clone https://github.com/GRI-ESPCI/intrarez
    cd intrarez
    python3 -m venv env
    source env/bin/activate
    pip install -r requirements.txt
    pip install gunicorn pymysql cryptography
    cp .conf_models/model.env .env
    
  • Créer et initialiser la base de données MySQL :

    sudo mysql -u root
    

    <div class="highlight highlight-source-sql position-relative" data-snippet-clipboard-copy-content="CREATE DATABASE intrarez CHARACTER SET utf8 COLLATE utf8_bin;
    CREATE USER 'intrarez'@'localhost' IDENTIFIED BY '’;
    GRANT ALL PRIVILEGES ON intrarez.* TO ‘intrarez’@’localhost’;
    FLUSH PRIVILEGES;
    QUIT;
    “>

    CREATE DATABASE intrarez CHARACTER SET utf8 COLLATE utf8_bin;
    CREATE USER 'intrarez'@'localhost' IDENTIFIED BY '<mdp-db>';
    GRANT ALL PRIVILEGES ON intrarez.* TO 'intrarez'@'localhost';
    FLUSH PRIVILEGES;
    QUIT;