PageRenderTime 53ms CodeModel.GetById 22ms RepoModel.GetById 0ms app.codeStats 0ms

/askbot-0.7.40/askbot/doc/build/html/management-commands.html

#
HTML | 305 lines | 295 code | 10 blank | 0 comment | 0 complexity | 01e19ac0e492a0d6b3ced8d5cbfa5cea MD5 | raw file
Possible License(s): GPL-3.0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  6. <title>Askbot management commands &mdash; Askbot v0.7.36 documentation</title>
  7. <link rel="stylesheet" href="_static/traditional.css" type="text/css" />
  8. <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
  9. <script type="text/javascript">
  10. var DOCUMENTATION_OPTIONS = {
  11. URL_ROOT: '',
  12. VERSION: '0.7.36',
  13. COLLAPSE_INDEX: false,
  14. FILE_SUFFIX: '.html',
  15. HAS_SOURCE: true
  16. };
  17. </script>
  18. <script type="text/javascript" src="_static/jquery.js"></script>
  19. <script type="text/javascript" src="_static/underscore.js"></script>
  20. <script type="text/javascript" src="_static/doctools.js"></script>
  21. <link rel="author" title="About these documents" href="about.html" />
  22. <link rel="top" title="Askbot v0.7.36 documentation" href="index.html" />
  23. <link rel="next" title="Sending email to askbot" href="sending-email-to-askbot.html" />
  24. <link rel="prev" title="Import other forums into Askbot" href="import-data.html" />
  25. </head>
  26. <body>
  27. <div class="logo">
  28. <a href="/doc/index.html"><h1>Askbot Project Documentation</h1></a>
  29. <div class="topnav">
  30. <a href="http://twitter.com/askbot7" alt="Follow us on twitter"><img src="_static/twitter.png"/></a>
  31. <a href="https://www.facebook.com/pages/Askbot/128297183877495" alt="like us on Facebook"><img src="_static/facebook.png"/></a>
  32. </div>
  33. </div>
  34. <div class="ab-proj-header">
  35. <a href="/">Home</a> |
  36. <a href="/en/questions/" title="Ask Questions">Ask Questions</a> |
  37. <a href="/hire-us" alt='Hire Us'>Hire Us</a> |
  38. <a href="/doc/index.html" alt="Documentation">Documentation</a> |
  39. <a href="/contribute" alt='Contribute'>Contribute</a> |
  40. <a href="/feedback/" alt='contact'>Contact</a>
  41. </div>
  42. <div class="document">
  43. <div class="documentwrapper">
  44. <div class="bodywrapper">
  45. <div class="body">
  46. <div class="section" id="askbot-management-commands">
  47. <h1>Askbot management commands<a class="headerlink" href="#askbot-management-commands" title="Permalink to this headline">ś</a></h1>
  48. <p>There are a number of command line utilities help the forum administrator
  49. perform a range of tasks such as add or revoke administration privileges, back up and restore
  50. the forum data, fix database errors if such occur, etc.</p>
  51. <p>To run these commands there is a general pattern:</p>
  52. <div class="highlight-python"><pre>cd project_directory
  53. python manage.py some_command [possible arguments and parameters]</pre>
  54. </div>
  55. <p>I.e. the commands are generally run from the project directory (the same
  56. one that contains your settings.py file) and they may use additional parameters and options.</p>
  57. <div class="section" id="data-and-user-administration-commands">
  58. <h2>Data and User administration commands<a class="headerlink" href="#data-and-user-administration-commands" title="Permalink to this headline">ś</a></h2>
  59. <p>The bulk of the management commands fall into this group and will probably be the most frequently used.</p>
  60. <table border="1" class="docutils">
  61. <colgroup>
  62. <col width="35%" />
  63. <col width="65%" />
  64. </colgroup>
  65. <thead valign="bottom">
  66. <tr><th class="head">command</th>
  67. <th class="head">purpose</th>
  68. </tr>
  69. </thead>
  70. <tbody valign="top">
  71. <tr><td><cite>add_admin &lt;user_id&gt;</cite></td>
  72. <td>Turn user into an administrator
  73. <cite>&lt;user_id&gt;</cite> is a numeric user id of the account</td>
  74. </tr>
  75. <tr><td><cite>remove_admin &lt;user_id&gt;</cite></td>
  76. <td>Remove admin status from a user account - the opposite of
  77. the <cite>add_admin</cite> command</td>
  78. </tr>
  79. <tr><td><cite>add_askbot_user &#8211;user-name
  80. &#8211;email [&#8211;password]</cite></td>
  81. <td>Create a user account. If password is not given, an
  82. unusable password will be set.
  83. The command does not create associations with
  84. any of the external login providers.</td>
  85. </tr>
  86. <tr><td><cite>merge_users &lt;from_id&gt;
  87. &lt;to_id&gt;</cite></td>
  88. <td>Merges user accounts and all related data from one user
  89. to another, the &#8220;from user&#8221; account is deleted.</td>
  90. </tr>
  91. <tr><td><cite>dump_forum [&#8211;dump-name
  92. some_name]</cite></td>
  93. <td>Save forum contents into a file. <cite>&#8211;dump-name</cite> parameter is
  94. optional</td>
  95. </tr>
  96. <tr><td><cite>get_tag_stats [-u|-t] [-e]</cite></td>
  97. <td>Print tag subscription statistics, per tag (option -t)
  98. or per user (option -u), if option -e is given, empty
  99. records will be shown too (longer versions of the options
  100. are: &#8211;per-tag-subscription-counts for -t,
  101. &#8211;per-user-tag-subscription-counts for -u, and &#8211;print-empty
  102. for -e).</td>
  103. </tr>
  104. <tr><td><cite>load_forum &lt;file_name&gt;</cite></td>
  105. <td>Load forum data from a file saved by the <cite>dump_forum</cite>
  106. command</td>
  107. </tr>
  108. <tr><td><cite>load_stackexchange &lt;file.zip&gt;</cite></td>
  109. <td>Load SackExchange dump into Askbot. It is best to run this
  110. command on empty database. Also - before running, make sure
  111. that <cite>askbot.importers.stackexchange</cite> is in the list of
  112. installed apps within your settings.py file (it might also
  113. be necessary to run <cite>syncdb</cite> command to initiate the
  114. SE importer tables).</td>
  115. </tr>
  116. <tr><td><cite>rename_tags &#8211;from &lt;from_tags&gt;
  117. &#8211;to &lt;to_tags&gt; &#8211;user-id
  118. &lt;user_id&gt;</cite></td>
  119. <td>Rename, merge or split tags. User ID is the id of the user
  120. who will be assigned as the performer of the retag action.
  121. If more than is in the <cite>&#8211;from</cite> or the <cite>&#8211;to</cite> parameters
  122. then that parameter quoted, e.g. <a href="#id1"><span class="problematic" id="id2">`</span></a>&#8211;to &#8220;tag1 tag2&#8221;.
  123. If user id is not given, the administrator with the smallest
  124. id number will be automatically assigned.</td>
  125. </tr>
  126. <tr><td><cite>rename_tags_id &#8211;from
  127. &lt;from_tag_ids&gt; &#8211;to
  128. &lt;to_tag_ids&gt; &#8211;user_id
  129. &lt;user_id&gt;</cite></td>
  130. <td>This command is the same as <cite>rename_tags</cite>, but takes the tag
  131. id&#8217;s as arguments.</td>
  132. </tr>
  133. <tr><td><cite>delete_unused_tags</cite></td>
  134. <td>Permanently deletes tags that do not appear in any questions
  135. , including the questions that are themselves
  136. marked as deleted.</td>
  137. </tr>
  138. <tr><td><cite>update_avatar_data</cite></td>
  139. <td>Set values of avatar types for all users;
  140. this command may take up to 2s per user, because it makes
  141. up to one http request per user to gravatar.com.
  142. This data is used to display preferentially real faces
  143. on the main page.</td>
  144. </tr>
  145. </tbody>
  146. </table>
  147. </div>
  148. <div class="section" id="email-related-commands">
  149. <span id="id3"></span><h2>Email-related commands<a class="headerlink" href="#email-related-commands" title="Permalink to this headline">ś</a></h2>
  150. <p>These commands deal with the periodic tasks related to sending and receiving email by askbot.
  151. A UNIX program called <cite>cron</cite> can run these commands at the specified times
  152. (please look up futher information about <cite>cron</cite> elsewhere).</p>
  153. <p>Any configurable options, related to these commands are accessible via &#8220;Email&#8221; section of the
  154. <a class="reference internal" href="live-settings.html#live-settings"><em>live settings</em></a>.</p>
  155. <table border="1" class="docutils">
  156. <colgroup>
  157. <col width="38%" />
  158. <col width="62%" />
  159. </colgroup>
  160. <thead valign="bottom">
  161. <tr><th class="head">command</th>
  162. <th class="head">purpose</th>
  163. </tr>
  164. </thead>
  165. <tbody valign="top">
  166. <tr><td><cite>send_email_alerts</cite></td>
  167. <td>Dispatches email alerts to the users according to
  168. their subscription settings. This command does not
  169. send instant&#8221; alerts because those are sent automatically
  170. and do not require a separate command.
  171. The most frequent alert setting that can be served by this
  172. command is &#8220;daily&#8221;, therefore running <cite>send_email_alerts</cite>
  173. more than twice a day is not necessary.</td>
  174. </tr>
  175. <tr><td><cite>post_emailed_questions</cite></td>
  176. <td>(experimental feature) posts questions sent by email
  177. to enable this feature - please follow the instructions
  178. on <a class="reference internal" href="sending-email-to-askbot.html"><em>sending email to askbot</em></a>.
  179. This command uses <a class="reference internal" href="live-settings.html#live-settings"><em>live settings</em></a>
  180. &#8220;allow posting by email&#8221; and &#8220;replace spaces in tags
  181. with dash&#8221;.</td>
  182. </tr>
  183. <tr><td><cite>send_unanswered_question_reminders</cite></td>
  184. <td>Sends periodic reminders about unanswered questions.
  185. This command may be disabled from the &#8220;email&#8221; section
  186. of <a class="reference internal" href="live-settings.html#live-settings"><em>live settings</em></a>, as well as
  187. an initial wait period and the recurrence delay may be set.</td>
  188. </tr>
  189. <tr><td><cite>send_accept_answer_reminders</cite></td>
  190. <td>Sends periodic reminders about accepting best answers.
  191. This command may be disabled from the &#8220;email&#8221; section
  192. of the live settings, as well as the appropriate delay
  193. parameters may be set.</td>
  194. </tr>
  195. </tbody>
  196. </table>
  197. </div>
  198. <div class="section" id="data-repair-commands">
  199. <h2>Data repair commands<a class="headerlink" href="#data-repair-commands" title="Permalink to this headline">ś</a></h2>
  200. <p>Under certain circumstances (especially when using MySQL database with MyISAM
  201. storage engine or when venturing to adapt the software to your needs) some
  202. records in the database tables may become internally inconsistent.
  203. The commands from this section will help fix those issues.</p>
  204. <div class="admonition note">
  205. <p class="first admonition-title">Note</p>
  206. <p class="last">Data inconsistency in the Askbot project is considered as a critical error and as a matter of
  207. the project policy is addressed on the day of reporting. If you discover such issue - please
  208. report it at the forum or by email at <cite>admin&#64;askbot.org</cite></p>
  209. </div>
  210. <table border="1" class="docutils">
  211. <colgroup>
  212. <col width="34%" />
  213. <col width="66%" />
  214. </colgroup>
  215. <thead valign="bottom">
  216. <tr><th class="head">command</th>
  217. <th class="head">purpose</th>
  218. </tr>
  219. </thead>
  220. <tbody valign="top">
  221. <tr><td><cite>add_missing_subscriptions</cite></td>
  222. <td>adds default values of email subscription settings to users
  223. that lack them</td>
  224. </tr>
  225. <tr><td><cite>fix_answer_counts</cite></td>
  226. <td>recalculates answer counts for all questions</td>
  227. </tr>
  228. <tr><td><cite>fix_inbox_counts</cite></td>
  229. <td>recalculates response counts in the user inboxes</td>
  230. </tr>
  231. <tr><td><cite>fix_revisionless_posts</cite></td>
  232. <td>adds a revision record to posts that lack them</td>
  233. </tr>
  234. <tr><td><cite>fix_question_tags</cite></td>
  235. <td>takes tag names from the record on the question table
  236. and stores them in the tag table. This defect may show when
  237. the server process is interrupted after the question was
  238. saved, but tags were not updated, and the symptom is that
  239. the question cannot be found via the tag search.</td>
  240. </tr>
  241. </tbody>
  242. </table>
  243. <p>The above commands are safe to run at any time, also they do not require
  244. additional parameters. In the future all these will be replaced with just one simple command.</p>
  245. </div>
  246. <div class="section" id="developer-commands">
  247. <h2>Developer commands<a class="headerlink" href="#developer-commands" title="Permalink to this headline">ś</a></h2>
  248. <p>Besides the commands designed to help run the forum, there are several aiming to help
  249. the developers of the Askbot project:</p>
  250. </div>
  251. </div>
  252. </div>
  253. </div>
  254. </div>
  255. <div class="sphinxsidebar">
  256. <div class="sphinxsidebarwrapper">
  257. <h3><a href="index.html">Table Of Contents</a></h3>
  258. <ul>
  259. <li><a class="reference internal" href="#">Askbot management commands</a><ul>
  260. <li><a class="reference internal" href="#data-and-user-administration-commands">Data and User administration commands</a></li>
  261. <li><a class="reference internal" href="#email-related-commands">Email-related commands</a></li>
  262. <li><a class="reference internal" href="#data-repair-commands">Data repair commands</a></li>
  263. <li><a class="reference internal" href="#developer-commands">Developer commands</a></li>
  264. </ul>
  265. </li>
  266. </ul>
  267. <h4>Previous topic</h4>
  268. <p class="topless"><a href="import-data.html"
  269. title="previous chapter">Import other forums into Askbot</a></p>
  270. <h4>Next topic</h4>
  271. <p class="topless"><a href="sending-email-to-askbot.html"
  272. title="next chapter">Sending email to askbot</a></p>
  273. <div id="searchbox" style="display: none">
  274. <h3>Quick search</h3>
  275. <form class="search" action="search.html" method="get">
  276. <input type="text" name="q" size="18" />
  277. <input type="submit" value="Go" />
  278. <input type="hidden" name="check_keywords" value="yes" />
  279. <input type="hidden" name="area" value="default" />
  280. </form>
  281. <p class="searchtip" style="font-size: 90%">
  282. Enter search terms or a module, class or function name.
  283. </p>
  284. </div>
  285. <script type="text/javascript">$('#searchbox').show(0);</script>
  286. </div>
  287. </div>
  288. <div class="clearer"></div>
  289. </div>
  290. <div class="footer">
  291. &copy; Copyright 2011, Askbot Project.
  292. Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.0.7.
  293. </div>
  294. </body>
  295. </html>