Go to file
Alexandre Iooss 5c3c8eed8e
Do not cover dead code
2020-02-09 15:08:52 +01:00
logs Translate logs app and cleanup 2019-08-16 20:14:52 +02:00
med Remove sporz app 2020-02-09 14:07:39 +01:00
media Add bedeteque scraper 2019-08-19 12:17:49 +02:00
theme Add REST API 2019-08-17 12:12:10 +02:00
users Add bedeteque scraper 2019-08-19 12:17:49 +02:00
.coveragerc Do not cover dead code 2020-02-09 15:08:52 +01:00
.gitignore Ignore vscode project configuration 2020-02-09 13:55:34 +01:00
.gitlab-ci.yml Test also with Python3.5 2019-08-02 14:36:06 +02:00
.pylintrc Update project base 2019-08-02 13:24:49 +02:00
COPYING Update project base 2019-08-02 13:24:49 +02:00
Dockerfile Docker 2020-02-02 18:22:28 +01:00
README.md Clarify Django commands 2020-02-09 15:08:27 +01:00
entrypoint.sh Clarify Django commands 2020-02-09 15:08:27 +01:00
manage.py Add Debian Stretch requirements 2019-08-02 13:32:09 +02:00
requirements.txt Add uwsgi configuration 2020-02-09 14:18:39 +01:00
tool_barcode_getblue.py Android barcode scanner 2019-08-11 12:05:05 +02:00
tox.ini CI passing! 2019-08-09 23:22:20 +02:00

README.md

Site de la Mediatek

License: GPL v3 pipeline status coverage report

Le projet Med permet la gestion de la base de donnée de la médiathèque de l'ENS Paris-Saclay. Elle permet de gérer les medias, bd, jeux, emprunts, ainsi que les adhérents de la med.

Licence

Ce projet est sous la licence GNU public license v3.0.

Installation

Développement

On peut soit développer avec Docker, soit utiliser un VirtualEnv.

Dans le cas du VirtualEnv,

python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
./manage.py compilemessages
./manage.py makemigrations
./manage.py migrate
./manage.py runserver

Production

Vous pouvez soit utiliser Docker, soit configurer manuellement le serveur.

Mise en place du projet sur Zamok

Pour mettre en place le projet sans droits root, on va créer un socket uwsgi dans le répertoire personnel de l'utilisateur club-med puis on va dire à Apache2 d'utiliser ce socket avec un .htaccess.

Pour cela on va imiter ce que fait l'image Docker,

python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
./entrypoint.sh

Configuration d'une base de données

Sur le serveur MySQL ou PostgreSQL, il est nécessaire de créer une base de donnée med, ainsi qu'un user med et un mot de passe associé.

Voici les étapes à executer pour MySQL :

CREATE DATABASE med;
CREATE USER 'med'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON med.* TO 'med'@'localhost';
FLUSH PRIVILEGES;

Et pour PostgreSQL :

CREATE DATABASE med;
CREATE USER med WITH PASSWORD 'password';
GRANT ALL PRIVILEGES ON DATABASE med TO med;

Exemple de groupes de droits

bureau
    media | Can view borrowed item
    media | Can add borrowed item
    media | Can change borrowed item
    media | Can delete borrowed item
    users | Can view adhesion
    users | Can add adhesion
    users | Can change adhesion
    users | Can delete adhesion
    users | Can view clef
    users | Can add clef
    users | Can change clef
    users | Can delete clef
    users | Can view user
    users | Can add user
    users | Can change user
    sporz | Can view gamesave
    + permissions keyholder

keyholder
    media | Can view author
    media | Can add author
    media | Can change author
    media | Can delete author
    media | Can view medium
    media | Can add medium
    media | Can change medium
    media | Can delete medium
    media | Can view game
    media | Can add game
    media | Can change game
    media | Can delete game
    media | Can view borrowed item
    media | Can add borrowed item
    media | Can change borrowed item
    media | Can delete borrowed item
    users | Can view user
    users | Can view clef

users (default group for everyone)
    media | Can view author
    media | Can view game
    media | Can view medium
    sporz | Can add gamesave
    sporz | Can change gamesave
    sporz | Can add player
    sporz | Can change player
    sporz | Can delete player
    sporz | Can view player