=========================================== Commands =========================================== Most of the available commands must be run from the main directory where the file :file:`manage.py` is located. This script accepts a command followed by mandatory and optional arguments. Usage: :samp:`./manage.py subcommand [options] [args]` The following options are always available: .. 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 Database related commands ============================ syncdb ------ The command :program:`./manage.py syncdb` creates the database tables for all apps in :const:`~settings.INSTALLED_APPS` whose tables haven't already been created, except those which use migrations. Usage: :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 ------- The command :program:`./manage.py migrate` runs migrations for all apps. Use this commands after an upgrade of OpenPLM to synchronize the database. Always make a backup of your data (database and files) before running this command! Usage: :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:: More documentation on this command is available `here `__. dbshell ------- Runs the command-line client for the database. Usage: :samp:`./manage.py dbshell` Search index related commands ================================ .. note:: Do not forget to set change the owner of the index directory to www-data (user who runs celery) rebuild_index --------------- The command :program:`./manage.py rebuild_index` completely rebuilds the search index by removing the old data and then updating. Usage: :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 ---------------- The command :program:`./manage.py update_index` freshens the index for the given app(s). Usage: :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:: More documentation on these commands is available `here `__. User related commands ======================== changepassword --------------- The command :program:`./manage.py changepassword` changes the password of the given user. Usage :samp:`./manage.py changepassword [options] {username}` createsuperuser ---------------- The command :program:`./manage.py createsuperuser` creates a new super user (administrator who can manage data through the admin interface). Usage :samp:`./manage.py createsuperuser [options]` createcompany ---------------- The command :program:`./manage.py createcompany` creates the *company* user (special user who owns official and deprecated parts and documents). Usage :samp:`./manage.py createcompany [options]` Translation related commands =============================== makemessages ------------------------------------ The command :program:`./manage.py makemessages` creates/updates a message file (extensions : .po) in the conf/locale (in the django tree) or locale (for project and application) directory. 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:: More documentation on these commands is available `here `__. .. note:: When you create/update message files for the main application use :program:`./manage.py makemessages - -ignore=apps/* [options]` If you want to create/update message files for a given application, first change your current directory to the application directory. compilemessages ------------------------------------ The command :program:`./manage.py compilemessages` compiles message files (.po) to .mo files . 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:: More documentation on these commands is available `here `__. .. note:: If you want to compile message files for a given application, first change your current directory to the application directory.