doc/administration.rst
author ymh <ymh.work@gmail.com>
Fri, 11 Oct 2013 13:24:03 +0200
changeset 147 e4d53c64f0d0
parent 145 7c6fe1dab213
child 153 50f01260eef4
permissions -rw-r--r--
Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
**************
137
bb8bf2688d7e - Finish and correct documentation
ymh <ymh.work@gmail.com>
parents: 132
diff changeset
     2
Administration
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
**************
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
     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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
     6
L`accès à ces commandes se fait par le script ``manage.py`` situee dans le répertoire ``src`` de l'application.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
     7
Il est bien sur indispensable d'activer l'environement virtuel de l'application (cf. :ref:`deployment-virtualenv`) avant de lancer ce script.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
     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.::
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
     9
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    10
    cd src
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    11
    python manage.py <commande> --help
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    12
     
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    13
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    14
Commandes à passer lors d'un upgrade de version
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
===============================================
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    17
Lors d'une mise à jour de l'application les commandes suivantes sont systématiquement à lancer :
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    18
::
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    19
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    20
    python manage.py syncdb --migrate
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    21
    python manage.py collectstatic
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    24
La deuxième sert à mettre à jour les resources statiques.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    25
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    26
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    27
Commande d'administration
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
=========================
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    35
``import_record``
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    36
-----------------
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    37
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    38
.. code-block:: bash
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    39
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    40
    $ python manage.py import_record --help     
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    41
    Usage: manage.py import_record [options] record_url ...
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    42
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    43
    Import p4l record rdf format
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    44
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    45
    Options:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    46
      -v VERBOSITY, --verbosity=VERBOSITY
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    47
                            Verbosity level; 0=minimal output, 1=normal output,
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    48
                            2=verbose output, 3=very verbose output
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    49
      --settings=SETTINGS   The Python path to a settings module, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    50
                            "myproject.settings.main". If this is not provided, the
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    51
                            DJANGO_SETTINGS_MODULE environment variable will be
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    52
                            used.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    53
      --pythonpath=PYTHONPATH
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    54
                            A directory to add to the Python path, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    55
                            "/home/djangoprojects/myproject".
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    56
      --traceback           Print traceback on exception
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    57
      -b BATCH_SIZE, --batch-size=BATCH_SIZE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    58
                            number of object to import in bulk operations
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    59
      -p, --preserve        preserve existing record
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    60
      -i, --index           index while importing
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    61
      --version             show program version number and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    62
      -h, --help            show this help message and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    63
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    64
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    66
Les options suivantes sont disponibles:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    67
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    68
  * ``-b BATCH_SIZE`` : contrôle la taille des lots lors de l'import.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    69
    Augmenter la taille des lots peut améliorer les performances lors de l'import mais augmente la consomation mémoire.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    70
    (valeur par défaut: 50)
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    71
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    72
  * ``-p`` : ne tente pas d'effacer les notices lors de l'import.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    73
    L'import d'une notice existante (même identifiant) proviquera une erreur et l'arrêt de l'import
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    74
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    75
  * ``-i`` : met à jour l'index des notices lors de l'import.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    76
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    77
Les points suivants sont à noter:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    78
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    79
  #. Toute erreur interrompt l'import des notices.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    80
  
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    81
  #. L'import d'un fichier n'estr pas transactionnel: i.e. un fichier peut être partiellement importé.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    82
  
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    83
  #. À un lot (option `b`) correspond une transaction de base de donnée.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    84
     Donc en cas d'erreur lors d'un l'import, le lot courant complet est annulé.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    85
  
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    86
  #. L'indexation n'est pas transactionnelle.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    88
     Il est à noté que dans ce cas, ces notices apparaîtrons dans la page de liste des notices.
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
    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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    94
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    95
``dump_record``
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    96
---------------
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    97
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    98
.. code-block:: bash
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
    99
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   100
    $ python manage.py dump_record --help
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   101
    Usage: manage.py dump_record [options] file_path...
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   103
    Export p4l record rdf format
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   104
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   105
    Options:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   106
      -v VERBOSITY, --verbosity=VERBOSITY
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   107
                            Verbosity level; 0=minimal output, 1=normal output,
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   108
                            2=verbose output, 3=very verbose output
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   109
      --settings=SETTINGS   The Python path to a settings module, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   110
                            "myproject.settings.main". If this is not provided, the
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   111
                            DJANGO_SETTINGS_MODULE environment variable will be
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   112
                            used.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   113
      --pythonpath=PYTHONPATH
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   114
                            A directory to add to the Python path, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   115
                            "/home/djangoprojects/myproject".
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   116
      --traceback           Print traceback on exception
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   117
      -l LIMIT, --limit=LIMIT
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   118
                            number of record to export. -1 is all (default)
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   119
      -s SKIP, --skip=SKIP  number of record to skip before export. default 0.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   120
      -b BATCH, --batch=BATCH
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   121
                            query batch default 100.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   122
      -j, --bzip2           bz2 compress
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   123
      -z, --gzip            gzip compress
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   124
      --version             show program version number and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   125
      -h, --help            show this help message and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   126
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   127
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   129
Lors de l'export les notices sont classées par leur identifiant (tri syntaxique ascendant). 
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   130
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   131
Les options suivantes sont disponibles:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   134
  * ``-l LIMIT`` : nombre maximum de notices à exporter. -1 (le défaut) exporte toute les notices.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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).
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   136
    Avec l'option ``-l``, cette option permet l'export des notices en lots.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   137
  * ``-j``, ``-z`` : permet la compression à la volée des données. La compression se fait au fur et à mesure de l'export.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   138
  
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   139
Les points suivants sont à noter:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   140
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   141
  #. Toute erreur interompt immédiatement l'export.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   142
  #. En cas d'erreur, l'export est immédiatement interrompu et le fichier produit ne sera pas valide.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   143
     En particulier, dans le cas où une option de compression a été activé, l'archive partielle crée peut s'avérer illisible.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   144
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   145
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   146
``rebuild_index``
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   147
-----------------
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   148
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   149
.. code-block:: bash
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
   150
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   151
    $ python manage.py rebuild_index  --help
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   152
    Usage: manage.py rebuild_index [options] 
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   153
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   154
    Completely rebuilds the search index by removing the old data and then updating.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   155
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   156
    Options:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   157
      -v VERBOSITY, --verbosity=VERBOSITY
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   158
                            Verbosity level; 0=minimal output, 1=normal output,
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   159
                            2=verbose output, 3=very verbose output
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   160
      --settings=SETTINGS   The Python path to a settings module, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   161
                            "myproject.settings.main". If this isn't provided, the
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   162
                            DJANGO_SETTINGS_MODULE environment variable will be
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   163
                            used.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   164
      --pythonpath=PYTHONPATH
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   165
                            A directory to add to the Python path, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   166
                            "/home/djangoprojects/myproject".
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   167
      --traceback           Print traceback on exception
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   168
      -a AGE, --age=AGE     Number of hours back to consider objects new.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   169
      -s START_DATE, --start=START_DATE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   170
                            The start date for indexing within. Can be any
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   171
                            dateutil-parsable string, recommended to be YYYY-MM-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   172
                            DDTHH:MM:SS.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   173
      -e END_DATE, --end=END_DATE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   174
                            The end date for indexing within. Can be any dateutil-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   175
                            parsable string, recommended to be YYYY-MM-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   176
                            DDTHH:MM:SS.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   177
      -b BATCHSIZE, --batch-size=BATCHSIZE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   178
                            Number of items to index at once.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   179
      -r, --remove          Remove objects from the index that are no longer
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   180
                            present in the database.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   181
      -u USING, --using=USING
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   182
                            Update only the named backend (can be used multiple
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   183
                            times). By default all backends will be updated.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   184
      -k WORKERS, --workers=WORKERS
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   185
                            Allows for the use multiple workers to parallelize
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   186
                            indexing. Requires multiprocessing.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   187
      --noinput             If provided, no prompts will be issued to the user and
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   188
                            the data will be wiped out.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   189
      --version             show program's version number and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   190
      -h, --help            show this help message and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   191
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   192
Commande utilisée pour reconstruire l'index Elasticsearch. L'age d'une notice est calculé à partir de sa date de mise à jour.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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. 
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   195
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   196
``update_index``
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   197
----------------
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   198
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   199
.. code-block:: bash
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
   200
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   201
    $ python manage.py update_index  --help
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   202
    Usage: manage.py update_index [options] <label label ...>
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   203
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   204
    Freshens the index for the given app(s).
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   205
    
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   206
    Options:
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   207
      -v VERBOSITY, --verbosity=VERBOSITY
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   208
                            Verbosity level; 0=minimal output, 1=normal output,
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   209
                            2=verbose output, 3=very verbose output
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   212
                            DJANGO_SETTINGS_MODULE environment variable will be
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   213
                            used.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   214
      --pythonpath=PYTHONPATH
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   215
                            A directory to add to the Python path, e.g.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   216
                            "/home/djangoprojects/myproject".
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   217
      --traceback           Print traceback on exception
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   218
      -a AGE, --age=AGE     Number of hours back to consider objects new.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   219
      -s START_DATE, --start=START_DATE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   220
                            The start date for indexing within. Can be any
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   221
                            dateutil-parsable string, recommended to be YYYY-MM-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   222
                            DDTHH:MM:SS.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   223
      -e END_DATE, --end=END_DATE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   224
                            The end date for indexing within. Can be any dateutil-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   225
                            parsable string, recommended to be YYYY-MM-
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   226
                            DDTHH:MM:SS.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   227
      -b BATCHSIZE, --batch-size=BATCHSIZE
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   228
                            Number of items to index at once.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   229
      -r, --remove          Remove objects from the index that are no longer
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   230
                            present in the database.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   231
      -u USING, --using=USING
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   232
                            Update only the named backend (can be used multiple
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   233
                            times). By default all backends will be updated.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   234
      -k WORKERS, --workers=WORKERS
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   235
                            Allows for the use multiple workers to parallelize
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   236
                            indexing. Requires multiprocessing.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   237
      --version             show program's version number and exit
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   238
      -h, --help            show this help message and exit
121
0d2a35462576 Add doc
ymh <ymh.work@gmail.com>
parents:
diff changeset
   239
132
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   240
Commande utilisée pour mettre à jour l'index Elasticsearch. L'age d'une notice est calculé à partir de sa date de mise à jour.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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. 
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   243
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   247
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   248
Le back-office offre une console d'administration donnant accès en particulier à la gestion des utilisateurs.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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/``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   250
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   255
L'administration des utilisateurs se fait à l'adresse suivante : ``<racine du site>/p4l/admin/p4l/user/``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   256
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   257
L'administration des groupes d'utilisateurs se fait à l'adresse suivante: ``<racine du site>/p4l/admin/auth/group/``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   258
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   259
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   260
L'interface de gestion est assez classique et ne présente pas de difficulté particulière.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   261
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   262
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   264
Le champ ``Permission de l'utilisateur`` doit donc comporter toutes les entrées de la forme ``p4l | <object> | <permission>``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   265
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   266
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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``.
b23fae63f732 - correction on documentation
ymh <ymh.work@gmail.com>
parents: 121
diff changeset
   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:
147
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   280
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   281
    * `args`: soit une séquence d'arguments de programme, soit une chaine de caractères
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   282
    * `cwd`: le chemin du reepertoire de travail. Par défaut : ``None``
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   283
    * `env`: dictionnire donnant les variables d'evironement positinnées durant l'éxeecution du script.
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
   284
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
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
   286
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
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
   288
147
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   289
.. code-block:: python
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
   290
147
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   291
    ADMIN_SCRIPT = {
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   292
        'args' : [ sys.executable, "manage.py", "dump_record", "--newline", "-j", "/tmp/script_dump.rdf.bz2"],
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   293
        'cwd' : "<chemin absolu des sources l'application>/src",
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   294
        'env' : {'PYTHONPATH': '<chemin absolu de l'environement virtuel>/lib/python2.7/site-packages'},
e4d53c64f0d0 Evolution doc correction for i18n. fix bug #7 (https://github.com/IRI-Research/plan4learning/issues/7)
ymh <ymh.work@gmail.com>
parents: 145
diff changeset
   295
    }
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
   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
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
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
   299
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
  * 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
   301
  * 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
   302
  * 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
   303
    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
   304
  * 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
   305
  * 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
   306
  * 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
   307
  * 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
   308
    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
   309
  * 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
   310
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
   311