Info | ||||
---|---|---|---|---|
| ||||
H5P n'est plus supporté dans Pod. à titre d'archive, vous pouvez toujours consulter l'ancienne doc ci-dessous : |
Désinstaller H5P
Info | ||
---|---|---|
| ||
Si vous souhaitez désinstaller proprement H5P, il vous faudra certainement modifier le fichier "h5pp/models.py" pour lui ajouter des "app_label = '...'" dans chaque class Meta. Une version corrigée se trouve ici : https://github.com/Badatos/H5PP/tree/patch-1 |
Commencez par retirer le bloc suivant de votre fichier custom/settings_local.py
##
# H5P relative parameters
#
[...]
BASE_URL = ...
Retirez-y également 'interactive' de la liste des THIRD_PARTY_APPS.
Une fois ceci fait, vous pouvez continuer à désinstaller les fichiers h5p restants :
Bloc de code | ||
---|---|---|
| ||
pip3 uninstall h5pp
rm -R /data/www/%userpod%/django_projects/H5PP
rm -R /data/www/%userpod%/django_projects/podv2/pod/static/h5p
rm -R /data/www/%userpod%/django_projects/podv2/pod/media/h5pp |
Installer H5P (deprecated)
Pour installer H5PP avec Podv2, la procédure est un peu particulière.
Voici les étapes nécessaires à cette installation :
1. Installation des packages
Bloc de code | ||||
---|---|---|---|---|
| ||||
[%userpod% ~]# cd [%userpod% ~]# source .bashrc [%userpod% ~]# cd /data/www/%userpod%/django_projects # Installation requests [%userpod% /data/www/%userpod%/django_projects]# pip3 install requests [%userpod% /data/www/%userpod%/django_projects]# workon django_pod (django_pod)[%userpod% /data/www/%userpod%/django_projects]# git clone https://github.com/EsupPortail/H5PP.git (django_pod)[%userpod% /data/www/%userpod%/django_projects]# cd H5PP (django_pod)[%userpod% /data/www/%userpod%/django_projects/H5PP]# git checkout --track origin/dev # Création du package H5PP (-> création de dist/H5PP-0.1.9.tar.gz) (django_pod)[%userpod% /data/www/%userpod%/django_projects/H5PP]# python setup.py sdist (django_pod)[%userpod% /data/www/%userpod%/django_projects/H5PP]# cd ../podv2 (django_pod)[%userpod% /data/www/%userpod%/django_projects/podv2]# pip3 install ../H5PP/dist/H5PP-0.1.9.tar.gz |
2. Configuration du plugin dans Pod
Pour activer le plugin dans Pod, il est nécessaire d'éditer son fichier custom/settings_local.py :
("interactive" correspond à h5p dans THIRD_PARTY_APPS)
Bloc de code | ||||
---|---|---|---|---|
| ||||
THIRD_PARTY_APPS = ['live', 'enrichment', 'interactive'] ## # H5P relative parameters # H5P_ENABLED = True # Active the module or not # H5P_VERSION = '7.x' # Current version of H5P module H5P_DEV_MODE = 0 # Active the development mode or not # H5P_PATH = os.path.join(BASE_DIR, 'h5pp/static/h5p') # Path to static ressources of H5PP module H5P_URL = '/h5p/' # All H5PP pages begin with this url H5P_SAVE = 30 # How often current content state should be saved H5P_EXPORT = '/exports/' # Location of exports (packages .h5p) H5P_LANGUAGE = 'fr' # Language of the module H5P. BASE_URL = 'https://pod-test.umontpellier.fr' # Hostname of your django ap |
...
Avertissement |
---|
3. Librairies nécessaires au module H5P
Il reste maintenant à installer les librairies nécessaires au module sous-jacent H5P.
...
? Il semblerait qu'il manque des éléments de style (CSS, images...) pour l'affichage dans Pod v2, mais l'ajout de librairies fonctionne correctement.
4. Actions complémentaires
Il semblerait que l'ensemble des fichiers statiques ne soient pas positionnés par défaut au bon endroit : avec Pod v2, la variable H5P_PATH ne semble pas être pris en compte et provoque même une erreur au démarrage.
Pour ma part, j'ai résolu ce problème en positionnant manuellement les fichiers statiques au bon endroit (cela n'est sûrement pas la meilleure méthode, mais cela fonctionne), à savoir :
Bloc de code | ||||
---|---|---|---|---|
| ||||
# Les fichiers statiques sont dans l'environnement virtuel. Il a fallu copier le répertoire h5p :
cp /data/www/%userpod%/.virtualenvs/django_pod/lib/python3.6/site-packages/h5pp/static/h5p /data/www/%userpod%/django_projects/podv2/pod/static/h5p -R |
À penser
Lors des maj, il faut vérifier les fichiers statics
Bloc de code | ||||
---|---|---|---|---|
| ||||
# Les fichiers statiques sont dans l'environnement virtuel. Il a fallu copier le répertoire h5p : cp /data/www/%userpod%/.virtualenvs/django_pod/lib/python3.6/site-packages/h5pp/static/h5p /data/www/%userpod%/django_projects/podv2/pod/static/h5p -R |