=========================================== Commandes =========================================== La plupart des commandes disponibles doivent être exécutées depuis le répertoire principal où se trouve le fichier :file:`manage.py` . Ce script accepte une commande suivie d'arguments requis ou optionnels. Utilisation : :samp:`./manage.py subcommand [options] [args]` Les options suivantes sont tout le temps disponibles : .. option:: -v VERBOSITY, --verbosity=VERBOSITY Verbosity level; 0=minimal output, 1=normal output, 2=all output .. option:: --traceback Print traceback on exception. Useful for debugging purpose. .. option:: --settings=SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. .. option:: --pythonpath=PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". .. option:: --version show Django's version number .. option:: -h, --help show an help message and exit Commandes liées à la base de données ===================================== syncdb ------ La commande :program:`./manage.py syncdb` crée les tables de base de données pour toutes les applications dans :const:`~settings.INSTALLED_APPS` dont les tables n'ont pas encore été créées, exceptées celles qui utilisent la migration. Utilisation : :samp:`./manage.py syncdb [options]` .. program:: ./manage.py syncdb .. option:: --all Makes syncdb work on all apps, even migrated ones. Be careful! This option should only be set to initialize if no tables were created. migrate ------- La commande :program:`./manage.py migrate` exécuter les migrations pour toutes les applications. Utilisez cette commande après une mise à jour d'OpenPLM pour synchroniser la base de données. Effectuez toujours une sauvegarde de vos données (base et fichiers) avant d'exécuter cette commande! Utilisation : :samp:`./manage.py migrate [options] [appname] [migrationname|zero] [--all] [--list] [--skip] [--merge] [--no-initial-data] [--fake] [--db-dry-run] [--database=dbalias]` .. program:: ./manage.py migrate .. option:: --all Run the specified migration for all apps. .. option:: --list List migrations noting those that have been applied .. option:: --skip Will skip over out-of-order missing migrations .. option:: --merge Will run out-of-order missing migrations as they are - no rollbacks. .. option:: --no-initial-data Skips loading initial data if specified. .. option:: --fake Pretends to do the migrations, but doesn't actually execute them. Only set this option if your database schema is synchronised with OpenPLM source code. .. option:: --db-dry-run Doesn't execute the SQL generated by the db methods, and doesn't store a record that the migration(s) occurred. Useful to test migrations before applying them. .. option:: --delete-ghost-migrations Tells South to delete any 'ghost' migrations (ones in the database but not on disk). .. option:: --ignore-ghost-migrations Tells South to ignore any 'ghost' migrations (ones in the database but not on disk) and continue to apply new migrations. .. seealso:: Plus de documentation sur cette commande `ici `__. dbshell ------- Lance l'interface en ligne de commande pour la base de données. Utilisation : :samp:`./manage.py dbshell` Index de recherche et commandes liées ====================================== .. note:: N'oubliez pas de modifier le propriétaire de répertoire d'index à www-data (utilisateur qui exécute celery) rebuild_index --------------- La commande :program:`./manage.py rebuild_index` re-construit complètement l'index de recherche en supprimant l'ancienne donnée puis en la mettant à jour. Utilisation : :samp:`./manage.py rebuild_index [options]` .. program:: ./manage.py rebuild_index .. option:: -a AGE, --age=AGE Number of hours back to consider objects new. .. option:: -b BATCHSIZE, --batch-size=BATCHSIZE Number of items to index at once. .. option:: -r, --remove Remove objects from the index that are no longer present in the database. .. option:: -k WORKERS, --workers=WORKERS Allows for the use multiple workers to parallelize indexing. Requires multiprocessing. update_index ---------------- La commande :program:`./manage.py update_index` rafraîchit l'index pour l' (les) application(s) données. Utilisation : :samp:`./manage.py update_index [options] <{appname} {appname} ...>` .. program:: ./manage.py update_index .. option:: -a AGE, --age=AGE Number of hours back to consider objects new. .. option:: -b BATCHSIZE, --batch-size=BATCHSIZE Number of items to index at once. .. option:: -r, --remove Remove objects from the index that are no longer present in the database. .. option:: -k WORKERS, --workers=WORKERS Allows for the use multiple workers to parallelize indexing. Requires multiprocessing. .. seealso:: Plus de documentation sur ces commandes `ici `__. Commandes relatives à l'utilisateur ==================================== changepassword --------------- La commande :program:`./manage.py changepassword` change le mot de passe de l'utilisateur donné. Utilisation : :samp:`./manage.py changepassword [options] {username}` createsuperuser ---------------- La commande :program:`./manage.py createsuperuser` crée un nouveau super-utilisateur (administrateur qui peut gérer les données via l'interface d'admin). Utiliation : :samp:`./manage.py createsuperuser [options]` createcompany ---------------- La commande :program:`./manage.py createcompany` crée l'utilisateur *company* (utilisateur spécial qui est propriétaire des parts et documents officiels et dépréciés). Utilisation : :samp:`./manage.py createcompany [options]` Commandes relatives à la traduction ==================================== makemessages ------------------------------------ La commande :program:`./manage.py makemessages` crée/met à jour les fichiers contenant les traductions (fichiers .po). Ces fichiers se trouvent dans le répertoire conf/locale (dans l'arborescence de django) ou locale (pour le projet et les applications). Usage :samp:`./manage.py makemessages [options]` .. program:: ./manage.py makemessages .. option:: -v VERBOSITY, --verbosity=VERBOSITY Verbosity level; 0=minimal output, 1=normal output, 2=all output .. option:: --settings=SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. .. option:: --pythonpath=PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". .. option:: --traceback Print traceback on exception .. option:: -l LOCALE, --locale=LOCALE Creates or updates the message files only for the given locale (e.g. pt_BR). .. option:: -a, --all Reexamines all source code and templates for new translation strings and updates all message files for all available languages. .. option:: -e EXTENSIONS, --extension=EXTENSIONS The file extension(s) to examine (default: ".html", separate multiple extensions with commas, or use -e multiple times) .. option:: -i PATTERN, --ignore=PATTERN Ignore files or directories matching this glob-style pattern. Use multiple times to ignore more. .. seealso:: Plus de documentations disponibles `ici `__. .. note:: Pour la création/mise à jour des traductions dans l'application principale, utilisez :program:`./manage.py makemessages - -ignore=apps/* [options]` . Pour la création/mise à jour des traductions d'une application ciblée , placez vous dans le répertoire de cette application et exécutez la commande de création de messages. compilemessages ------------------------------------ La commande :program:`./manage.py compilemessages` compile les fichiers .po vers des fichiers .mo . Usage :samp:`./manage.py compilemessages [options]` .. program:: ./manage.py compilemessages .. option:: -v VERBOSITY, --verbosity=VERBOSITY Verbosity level; 0=minimal output, 1=normal output, 2=all output .. option:: --settings=SETTINGS The Python path to a settings module, e.g. "myproject.settings.main". If this isn't provided, the DJANGO_SETTINGS_MODULE environment variable will be used. .. option:: --pythonpath=PYTHONPATH A directory to add to the Python path, e.g. "/home/djangoprojects/myproject". .. option:: --traceback Print traceback on exception .. option:: -l LOCALE, --locale=LOCALE The locale to process. Default is to process all. .. seealso:: Plus de documentations `ici `__. .. note:: Pour compiler les traductions d'une application ciblée , placez vous dans le répertoire de cette application puis compilez vos traductions.