diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-12-18 01:37:10 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-12-18 01:37:10 -0500 |
commit | f439304ce1ba3e69d411519c2d9a015c01e1d2f3 (patch) | |
tree | 900d02b7910d1f81fc247ad3dedfc593e8323166 | |
parent | 996c26084c6bed2129af9b06fa8fc1f61f93402b (diff) | |
download | askbot-f439304ce1ba3e69d411519c2d9a015c01e1d2f3.tar.gz askbot-f439304ce1ba3e69d411519c2d9a015c01e1d2f3.tar.bz2 askbot-f439304ce1ba3e69d411519c2d9a015c01e1d2f3.zip |
documented the most useful management commands
-rw-r--r-- | askbot/doc/source/index.rst | 2 | ||||
-rw-r--r-- | askbot/doc/source/management-commands.rst | 58 | ||||
-rw-r--r-- | askbot/management/commands/make_docs.py | 11 |
3 files changed, 65 insertions, 6 deletions
diff --git a/askbot/doc/source/index.rst b/askbot/doc/source/index.rst index 234d3163..b986df3a 100644 --- a/askbot/doc/source/index.rst +++ b/askbot/doc/source/index.rst @@ -19,7 +19,7 @@ at the forum_ or by email at admin@askbot.org Create and configure the site files<initial-configuration> Initialize the database tables <initialize-database-tables> Deploy on a webserver <deployment> - Maintenance procedures <management-commands> + Appendix A: Maintenance procedures <management-commands> Some background information: Askbot is written in Python on top of the Django platform. Code of Askbot grew out of CNPROG project originally written by diff --git a/askbot/doc/source/management-commands.rst b/askbot/doc/source/management-commands.rst index 81c9c877..deed097a 100644 --- a/askbot/doc/source/management-commands.rst +++ b/askbot/doc/source/management-commands.rst @@ -38,6 +38,17 @@ The bulk of the management commands fall into this group and will probably be th | --to <to_tags> --user-id | who will be assigned as the performer of the retag action. | | <user_id>` | If more than is in the `--from` or the `--to` parameters | | | then that parameter quoted, e.g. `--to "tag1 tag2". | +| | If user id is not given, the administrator with the smallest| +| | id number will be automatically assigned. | ++---------------------------------+-------------------------------------------------------------+ +| `rename_tags_id --from | This command is the same as `rename_tags`, but takes the tag| +| <from_tag_ids> --to | id's as arguments. | +| <to_tag_ids> --user_id | | +| <user_id>` | | ++---------------------------------+-------------------------------------------------------------+ +| `delete_unused_tags` | Permanently deletes tags that do not appear in any questions| +| | , including the questions that are themselves | +| | marked as deleted. | +---------------------------------+-------------------------------------------------------------+ Batch jobs @@ -60,10 +71,47 @@ Batch jobs are those that should be run periodically. A program called `cron` ca Data repair commands ==================== -Under certain circumstances (especially when using MySQL database with MyISAM storage engine or when venturing to adapt the software to your needs) some records in the database tables may become internally inconsistent. The commands from this section will help fix those issues: +Under certain circumstances (especially when using MySQL database with MyISAM +storage engine or when venturing to adapt the software to your needs) some +records in the database tables may become internally inconsistent. +The commands from this section will help fix those issues. + +.. note:: + + Data inconsistency in the Askbot project is considered as a critical error and as a matter of + the project policy is addressed on the day of reporting. If you discover such issue - please + report it at the forum or by email at `admin@askbot.org` + ++--------------------------------+-------------------------------------------------------------+ +| command | purpose | ++================================+=============================================================+ +| `add_missing_subscriptions` | adds default values of email subscription settings to users | +| | that lack them | ++--------------------------------+-------------------------------------------------------------+ +| `fix_answer_counts` | recalculates answer counts for all questions | ++--------------------------------+-------------------------------------------------------------+ +| `fix_revisionless_posts` | adds a revision record to posts that lack them | ++--------------------------------+-------------------------------------------------------------+ + +The above commands are safe to run at any time, also they do not require +additional parameters. In the future all these will be replaced with just one simple command. + +Developer commands +================== -* `add_missing_subscriptions` - adds default values of email subscription settings to users that lack them -* `fix_answer_counts` - recalculates answer counts for all questions -* `fix_revisionless_posts` - adds a revision record to posts that lack them +Besides the commands designed to help run the forum, there are several aiming to help +the developers of the Askbot project: -The commands are safe to run at any time, also they do not require additional parameters. In the future all these will be replaced with just one simple command. ++--------------------------------+-------------------------------------------------------------+ +| command | purpose | ++================================+=============================================================+ +| `make_docs` | Rebuild HTML documentation for the project | ++--------------------------------+-------------------------------------------------------------+ +| `jinja2_makemessages` | Extract translatable strings into the `.po` files. Works | +| | exactly the same way as the django `makemessages` command | +| | but extracts strings from Jinja2 templates that are used | +| | by the Askbot project. **Note:** the `jinja2_makemessages` | +| | must be run from the `askbot` app directory, unlike all the | +| | remaining commands that are expected to be run from the | +| | site root directory. | ++--------------------------------+-------------------------------------------------------------+ diff --git a/askbot/management/commands/make_docs.py b/askbot/management/commands/make_docs.py new file mode 100644 index 00000000..334e0876 --- /dev/null +++ b/askbot/management/commands/make_docs.py @@ -0,0 +1,11 @@ +import subprocess, os +from django.core.management.base import NoArgsCommand +import askbot + +DOC_DIR = os.path.join(askbot.get_install_directory(), 'doc') + +class Command(NoArgsCommand): + def handle_noargs(self, **options): + os.chdir(DOC_DIR) + subprocess.call(['make', 'html']) + |