| author | ymh <ymh.work@gmail.com> |
| Fri, 11 Oct 2013 11:46:18 +0200 | |
| changeset 145 | 7c6fe1dab213 |
| parent 137 | bb8bf2688d7e |
| child 147 | e4d53c64f0d0 |
| permissions | -rw-r--r-- |
| 121 | 1 |
************** |
|
137
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
2 |
Administration |
| 121 | 3 |
************** |
4 |
||
| 132 | 5 |
Django et ses modules d'extensions propose de nombreuses commande d'administration. Le but est ici d'en lister les plus utiles pour l'administration de l'application. |
6 |
L`accès à ces commandes se fait par le script ``manage.py`` situee dans le répertoire ``src`` de l'application. |
|
7 |
Il est bien sur indispensable d'activer l'environement virtuel de l'application (cf. :ref:`deployment-virtualenv`) avant de lancer ce script. |
|
8 |
Le reste des commandes est documenté soit à l'adresse suivante : https://docs.djangoproject.com/en/1.5/ref/django-admin/, soit directement en invoquant la commande avec l'option ``--help`` i.e.:: |
|
9 |
||
10 |
cd src |
|
11 |
python manage.py <commande> --help |
|
12 |
|
|
13 |
||
14 |
Commandes à passer lors d'un upgrade de version |
|
| 121 | 15 |
=============================================== |
16 |
||
| 132 | 17 |
Lors d'une mise à jour de l'application les commandes suivantes sont systématiquement à lancer : |
18 |
:: |
|
19 |
||
20 |
python manage.py syncdb --migrate |
|
21 |
python manage.py collectstatic |
|
| 121 | 22 |
|
| 132 | 23 |
La première permet la mise à jour du schéma de la base de donnée et de lancer les éventuelles migration de données. |
24 |
La deuxième sert à mettre à jour les resources statiques. |
|
25 |
||
26 |
||
27 |
Commande d'administration |
|
| 121 | 28 |
========================= |
29 |
||
|
145
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
30 |
Voici une liste des commandes servant à gérer l'import et l'export des notices (``Record``). |
| 132 | 31 |
|
|
137
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
32 |
|
|
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
33 |
.. _admin-import-record: |
|
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
34 |
|
| 132 | 35 |
``import_record`` |
36 |
----------------- |
|
37 |
||
38 |
.. code-block:: bash |
|
39 |
||
40 |
$ python manage.py import_record --help |
|
41 |
Usage: manage.py import_record [options] record_url ... |
|
42 |
||
43 |
Import p4l record rdf format |
|
44 |
||
45 |
Options: |
|
46 |
-v VERBOSITY, --verbosity=VERBOSITY |
|
47 |
Verbosity level; 0=minimal output, 1=normal output, |
|
48 |
2=verbose output, 3=very verbose output |
|
49 |
--settings=SETTINGS The Python path to a settings module, e.g. |
|
50 |
"myproject.settings.main". If this is not provided, the |
|
51 |
DJANGO_SETTINGS_MODULE environment variable will be |
|
52 |
used. |
|
53 |
--pythonpath=PYTHONPATH |
|
54 |
A directory to add to the Python path, e.g. |
|
55 |
"/home/djangoprojects/myproject". |
|
56 |
--traceback Print traceback on exception |
|
57 |
-b BATCH_SIZE, --batch-size=BATCH_SIZE |
|
58 |
number of object to import in bulk operations |
|
59 |
-p, --preserve preserve existing record |
|
60 |
-i, --index index while importing |
|
61 |
--version show program version number and exit |
|
62 |
-h, --help show this help message and exit |
|
63 |
||
64 |
||
65 |
Cette commande importe des notices en format rdf speecifique au projet dans l'application. Elle prend comme argument une liste de chemin vers les fichiers à importer. |
|
66 |
Les options suivantes sont disponibles: |
|
67 |
||
68 |
* ``-b BATCH_SIZE`` : contrôle la taille des lots lors de l'import. |
|
69 |
Augmenter la taille des lots peut améliorer les performances lors de l'import mais augmente la consomation mémoire. |
|
70 |
(valeur par défaut: 50) |
|
71 |
||
72 |
* ``-p`` : ne tente pas d'effacer les notices lors de l'import. |
|
73 |
L'import d'une notice existante (même identifiant) proviquera une erreur et l'arrêt de l'import |
|
74 |
||
75 |
* ``-i`` : met à jour l'index des notices lors de l'import. |
|
76 |
||
77 |
Les points suivants sont à noter: |
|
78 |
||
79 |
#. Toute erreur interrompt l'import des notices. |
|
80 |
||
81 |
#. L'import d'un fichier n'estr pas transactionnel: i.e. un fichier peut être partiellement importé. |
|
82 |
||
83 |
#. À un lot (option `b`) correspond une transaction de base de donnée. |
|
84 |
Donc en cas d'erreur lors d'un l'import, le lot courant complet est annulé. |
|
85 |
||
86 |
#. L'indexation n'est pas transactionnelle. |
|
87 |
Donc en cas d'erreur d'import il est possible que certaine notice ait été indexée mais ne se retrouve pas finalement en base. |
|
88 |
Il est à noté que dans ce cas, ces notices apparaîtrons dans la page de liste des notices. |
|
| 121 | 89 |
|
|
137
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
90 |
#. Pour des imports massif, il est souvent plus interessant de desactiver l'indexation à la volée et de lancer si c'est possible une mise à jour de l'index (cf. `update_index`_) et sinon sa reconstruction. (cf. `rebuild_index`_) |
|
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
91 |
|
|
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
92 |
|
|
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
93 |
.. _admin-dump-record: |
| 132 | 94 |
|
95 |
``dump_record`` |
|
96 |
--------------- |
|
97 |
||
98 |
.. code-block:: bash |
|
99 |
||
100 |
$ python manage.py dump_record --help |
|
101 |
Usage: manage.py dump_record [options] file_path... |
|
| 121 | 102 |
|
| 132 | 103 |
Export p4l record rdf format |
104 |
||
105 |
Options: |
|
106 |
-v VERBOSITY, --verbosity=VERBOSITY |
|
107 |
Verbosity level; 0=minimal output, 1=normal output, |
|
108 |
2=verbose output, 3=very verbose output |
|
109 |
--settings=SETTINGS The Python path to a settings module, e.g. |
|
110 |
"myproject.settings.main". If this is not provided, the |
|
111 |
DJANGO_SETTINGS_MODULE environment variable will be |
|
112 |
used. |
|
113 |
--pythonpath=PYTHONPATH |
|
114 |
A directory to add to the Python path, e.g. |
|
115 |
"/home/djangoprojects/myproject". |
|
116 |
--traceback Print traceback on exception |
|
117 |
-l LIMIT, --limit=LIMIT |
|
118 |
number of record to export. -1 is all (default) |
|
119 |
-s SKIP, --skip=SKIP number of record to skip before export. default 0. |
|
120 |
-b BATCH, --batch=BATCH |
|
121 |
query batch default 100. |
|
122 |
-j, --bzip2 bz2 compress |
|
123 |
-z, --gzip gzip compress |
|
124 |
--version show program version number and exit |
|
125 |
-h, --help show this help message and exit |
|
126 |
||
127 |
||
128 |
Cette commande exporte des notices en format rdf. Elle prend comme argument le chemin d'un fichier. Si le fichier existe, celui-ci sera écrasé sans aucune confirmation. |
|
129 |
Lors de l'export les notices sont classées par leur identifiant (tri syntaxique ascendant). |
|
130 |
||
131 |
Les options suivantes sont disponibles: |
|
132 |
||
133 |
* ``-b BATCH`` : tailles des lots de notices par requête de base de données. La valeur de ce paramêtre dépend des performances et capacité du serveur de base de données et de la machine d'export. |
|
134 |
* ``-l LIMIT`` : nombre maximum de notices à exporter. -1 (le défaut) exporte toute les notices. |
|
135 |
* ``-s SKIP`` : nombre de notice à ignorer avant de commencer l'export. O par défaut. Rappel: Lors de l'export les notices sont classées par leur identifiant (tri syntaxique ascendant). |
|
136 |
Avec l'option ``-l``, cette option permet l'export des notices en lots. |
|
137 |
* ``-j``, ``-z`` : permet la compression à la volée des données. La compression se fait au fur et à mesure de l'export. |
|
138 |
||
139 |
Les points suivants sont à noter: |
|
140 |
||
141 |
#. Toute erreur interompt immédiatement l'export. |
|
142 |
#. En cas d'erreur, l'export est immédiatement interrompu et le fichier produit ne sera pas valide. |
|
143 |
En particulier, dans le cas où une option de compression a été activé, l'archive partielle crée peut s'avérer illisible. |
|
144 |
||
145 |
||
146 |
``rebuild_index`` |
|
147 |
----------------- |
|
148 |
||
149 |
.. code-block:: bash |
|
| 121 | 150 |
|
| 132 | 151 |
$ python manage.py rebuild_index --help |
152 |
Usage: manage.py rebuild_index [options] |
|
153 |
||
154 |
Completely rebuilds the search index by removing the old data and then updating. |
|
155 |
||
156 |
Options: |
|
157 |
-v VERBOSITY, --verbosity=VERBOSITY |
|
158 |
Verbosity level; 0=minimal output, 1=normal output, |
|
159 |
2=verbose output, 3=very verbose output |
|
160 |
--settings=SETTINGS The Python path to a settings module, e.g. |
|
161 |
"myproject.settings.main". If this isn't provided, the |
|
162 |
DJANGO_SETTINGS_MODULE environment variable will be |
|
163 |
used. |
|
164 |
--pythonpath=PYTHONPATH |
|
165 |
A directory to add to the Python path, e.g. |
|
166 |
"/home/djangoprojects/myproject". |
|
167 |
--traceback Print traceback on exception |
|
168 |
-a AGE, --age=AGE Number of hours back to consider objects new. |
|
169 |
-s START_DATE, --start=START_DATE |
|
170 |
The start date for indexing within. Can be any |
|
171 |
dateutil-parsable string, recommended to be YYYY-MM- |
|
172 |
DDTHH:MM:SS. |
|
173 |
-e END_DATE, --end=END_DATE |
|
174 |
The end date for indexing within. Can be any dateutil- |
|
175 |
parsable string, recommended to be YYYY-MM- |
|
176 |
DDTHH:MM:SS. |
|
177 |
-b BATCHSIZE, --batch-size=BATCHSIZE |
|
178 |
Number of items to index at once. |
|
179 |
-r, --remove Remove objects from the index that are no longer |
|
180 |
present in the database. |
|
181 |
-u USING, --using=USING |
|
182 |
Update only the named backend (can be used multiple |
|
183 |
times). By default all backends will be updated. |
|
184 |
-k WORKERS, --workers=WORKERS |
|
185 |
Allows for the use multiple workers to parallelize |
|
186 |
indexing. Requires multiprocessing. |
|
187 |
--noinput If provided, no prompts will be issued to the user and |
|
188 |
the data will be wiped out. |
|
189 |
--version show program's version number and exit |
|
190 |
-h, --help show this help message and exit |
|
191 |
||
192 |
Commande utilisée pour reconstruire l'index Elasticsearch. L'age d'une notice est calculé à partir de sa date de mise à jour. |
|
193 |
Cette date est la date d'import de la notice si elle n'a pas été mise à jour dans l'application, et sa date de création si elle a été créée dans l'application. |
|
194 |
Cette commande est fournie par le module Django ``Haystack``. Sa documentation se trouve à l'adresse suivante : http://django-haystack.readthedocs.org/en/v2.1.0/management_commands.html |
|
195 |
||
196 |
``update_index`` |
|
197 |
---------------- |
|
198 |
||
199 |
.. code-block:: bash |
|
| 121 | 200 |
|
| 132 | 201 |
$ python manage.py update_index --help |
202 |
Usage: manage.py update_index [options] <label label ...> |
|
203 |
||
204 |
Freshens the index for the given app(s). |
|
205 |
||
206 |
Options: |
|
207 |
-v VERBOSITY, --verbosity=VERBOSITY |
|
208 |
Verbosity level; 0=minimal output, 1=normal output, |
|
209 |
2=verbose output, 3=very verbose output |
|
210 |
--settings=SETTINGS The Python path to a settings module, e.g. |
|
|
137
bb8bf2688d7e
- Finish and correct documentation
ymh <ymh.work@gmail.com>
parents:
132
diff
changeset
|
211 |
"myproject.settings.main". If this is not provided, the |
| 132 | 212 |
DJANGO_SETTINGS_MODULE environment variable will be |
213 |
used. |
|
214 |
--pythonpath=PYTHONPATH |
|
215 |
A directory to add to the Python path, e.g. |
|
216 |
"/home/djangoprojects/myproject". |
|
217 |
--traceback Print traceback on exception |
|
218 |
-a AGE, --age=AGE Number of hours back to consider objects new. |
|
219 |
-s START_DATE, --start=START_DATE |
|
220 |
The start date for indexing within. Can be any |
|
221 |
dateutil-parsable string, recommended to be YYYY-MM- |
|
222 |
DDTHH:MM:SS. |
|
223 |
-e END_DATE, --end=END_DATE |
|
224 |
The end date for indexing within. Can be any dateutil- |
|
225 |
parsable string, recommended to be YYYY-MM- |
|
226 |
DDTHH:MM:SS. |
|
227 |
-b BATCHSIZE, --batch-size=BATCHSIZE |
|
228 |
Number of items to index at once. |
|
229 |
-r, --remove Remove objects from the index that are no longer |
|
230 |
present in the database. |
|
231 |
-u USING, --using=USING |
|
232 |
Update only the named backend (can be used multiple |
|
233 |
times). By default all backends will be updated. |
|
234 |
-k WORKERS, --workers=WORKERS |
|
235 |
Allows for the use multiple workers to parallelize |
|
236 |
indexing. Requires multiprocessing. |
|
237 |
--version show program's version number and exit |
|
238 |
-h, --help show this help message and exit |
|
| 121 | 239 |
|
| 132 | 240 |
Commande utilisée pour mettre à jour l'index Elasticsearch. L'age d'une notice est calculé à partir de sa date de mise à jour. |
241 |
Cette date est la date d'import de la notice si elle n'a pas été mise à jour dans l'application, et sa date de création si elle a été créée dans l'application. |
|
242 |
Cette commande est fournie par le module Django ``Haystack``. Sa documentation se trouve à l'adresse suivante : http://django-haystack.readthedocs.org/en/v2.1.0/management_commands.html |
|
243 |
||
244 |
||
|
145
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
245 |
console d'administration |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
246 |
======================== |
| 132 | 247 |
|
248 |
Le back-office offre une console d'administration donnant accès en particulier à la gestion des utilisateurs. |
|
249 |
On y accède par le lien ``admin`` dans l'en-tête des pages si on est connecté en tant qu'administrateur ou bien en allant directement à l'adresse ``<racine du site>/p4l/admin/``. |
|
250 |
||
251 |
||
|
145
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
252 |
gestion des utilisateurs |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
253 |
------------------------ |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
254 |
|
| 132 | 255 |
L'administration des utilisateurs se fait à l'adresse suivante : ``<racine du site>/p4l/admin/p4l/user/``. |
256 |
||
257 |
L'administration des groupes d'utilisateurs se fait à l'adresse suivante: ``<racine du site>/p4l/admin/auth/group/``. |
|
258 |
||
259 |
||
260 |
L'interface de gestion est assez classique et ne présente pas de difficulté particulière. |
|
261 |
||
262 |
||
263 |
Pour qu'un utilisateur puisse créer et mettre à jour des enregistrements (``Records``), il faut qu'il ait les permissions d'ajout, de modification et d'effacement de tous les objets de l'application ``p4l``. |
|
264 |
Le champ ``Permission de l'utilisateur`` doit donc comporter toutes les entrées de la forme ``p4l | <object> | <permission>``. |
|
265 |
||
266 |
||
267 |
Pour faciliter la gestion de ces permissions, le plus simple est de créer un groupe ``utilisateurs``. On affectera à ce groupe toutes les permissions sur les objects de l'application ``p4l``. |
|
268 |
il suffira ensuite de mettre les utilisateurs dans ce groupe (champ ``Groupes`` dans l'interface d'édition des utilisateurs). L'utilisateur héritera alors des parmissions du groupe. |
|
|
145
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
269 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
270 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
271 |
Lancement d'un script |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
272 |
--------------------- |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
273 |
Il est possible de lancer un script à partir de l'adresse suivante : ``<racine du site>/p4l/admin/confirm_script``. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
274 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
275 |
Le script qui est exécuté est configuré par la propriété ``ADMIN_SCRIPT`` dans la configuration de l'application (``src/p4l/config.py``). |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
276 |
Cette propriété est un dictionnaire dont les clés sont les arguments du constructeur de subprocess.Popen. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
277 |
Tous les arguments et le fonctionnement de cet objet sont détaillés à l'adresse suivante : http://docs.python.org/2/library/subprocess.html#popen-constructor |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
278 |
Tous les arguments sont configurables sauf les suivants : ``stdout``, ``stderr``, ``bufsize``, ``close_fds``, ``preexec_fn``. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
279 |
Cependant les quatres suivants seront les plus utiles: |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
280 |
* `args`: soit une séquence d'arguments de programme, soit une chaine de caractères |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
281 |
* `cwd`: le chemin du reepertoire de travail. Par défaut : ``None`` |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
282 |
* `env`: dictionnire donnant les variables d'evironement positinnées durant l'éxeecution du script. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
283 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
284 |
Il est recommandé que ``args`` soit une liste d'arguments et non une simple chaîne de caractères. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
285 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
286 |
L'example suivant démontre comment on peut configurer cette propriété pour lancer le dump des notices avec la commande ``dump_record``. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
287 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
288 |
.. code-block :: python |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
289 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
290 |
ADMIN_SCRIPT = { |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
291 |
'args' : [ sys.executable, "manage.py", "dump_record", "--newline", "-j", "/tmp/script_dump.rdf.bz2"], |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
292 |
'cwd' : "<chemin absolu des sources l'application>/src", |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
293 |
'env' : {'PYTHONPATH': '<chemin absolu de l'environement virtuel>/lib/python2.7/site-packages'} |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
294 |
} |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
295 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
296 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
297 |
Plusieurs points sont à noter: |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
298 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
299 |
* L'utilisation de cette fonctionnalité est à priori réservé pour une application installé sous Unix. (cela peut fonctionner sous Windows, mais cela n'a pas été testé) |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
300 |
* La fermeture de la fenêtre du navigateur ne stoppe pas la commande |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
301 |
* En particulier si la session de l'utilisateur expire ou bien que la fenêtre du browser est fermée, il n'y a plus possibilité de stopper le processus à partir d'un browser. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
302 |
Le processus devra être interompu par les moyens habituels directement sur le serveur |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
303 |
* La commande est lancée dans le contexte du serveur web. Elle est donc executé par l'utilisateur du serveur web et hérite de ces droits d'accès. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
304 |
* Tout démarrage du serveur web stoppe la commande. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
305 |
* La commande partage les ressources du serveurs web. Attention donc à ne pas lancer des commandes trop gourmandes en ressources, cela peut avoir des conséquences sur la stabilité du serveur web et sa disponibilité. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
306 |
* L'affichage de la sortie de la commande dans le browser se fait ligne par ligne. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
307 |
Si la sortie de la commande ne comporte pas de caractère de retour à la ligne (``"\n"``) rien ne s'affichera avant la fin de la commande. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
308 |
* Les sorties erreur et standard sont affichée ensemble sans différentiation. |
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
309 |
|
|
7c6fe1dab213
Add a screen in the admin to launch commands. Fix bug #4 (https://github.com/IRI-Research/plan4learning/issues/4).
ymh <ymh.work@gmail.com>
parents:
137
diff
changeset
|
310 |