django-admin.1 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. .TH "django-admin.py" "1" "March 2008" "Django Project" ""
  2. .SH "NAME"
  3. django\-admin.py \- Utility script for the Django web framework
  4. .SH "SYNOPSIS"
  5. .B django\-admin.py
  6. .I <action>
  7. .B [options]
  8. .sp
  9. .SH "DESCRIPTION"
  10. This utility script provides commands for creation and maintenance of Django
  11. projects and apps.
  12. .sp
  13. With the exception of
  14. .BI startproject,
  15. all commands listed below can also be performed with the
  16. .BI manage.py
  17. script found at the top level of each Django project directory.
  18. .sp
  19. .SH "ACTIONS"
  20. .TP
  21. .BI "adminindex [" "appname ..." "]"
  22. Prints the admin\-index template snippet for the given app name(s).
  23. .TP
  24. .BI cleanup
  25. Cleans out old data from the database (only expired sessions at the moment).
  26. .TP
  27. .BI "compilemessages [" "\-\-locale=LOCALE" "]"
  28. Compiles .po files to .mo files for use with builtin gettext support.
  29. .TP
  30. .BI "createcachetable [" "tablename" "]"
  31. Creates the table needed to use the SQL cache backend
  32. .TP
  33. .B dbshell
  34. Runs the command\-line client for the current
  35. .BI DATABASE_ENGINE.
  36. .TP
  37. .B diffsettings
  38. Displays differences between the current
  39. .B settings.py
  40. and Django's default settings. Settings that don't appear in the defaults are
  41. followed by "###".
  42. .TP
  43. .B inspectdb
  44. Introspects the database tables in the database specified in settings.py and outputs a Django
  45. model module.
  46. .TP
  47. .BI "install [" "appname ..." "]"
  48. Executes
  49. .B sqlall
  50. for the given app(s) in the current database.
  51. .TP
  52. .BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-all" "]"
  53. Runs over the entire source tree of the current directory and pulls out all
  54. strings marked for translation. It creates (or updates) a message file in the
  55. conf/locale (in the django tree) or locale (for project and application) directory.
  56. .TP
  57. .BI "reset [" "appname ..." "]"
  58. Executes
  59. .B sqlreset
  60. for the given app(s) in the current database.
  61. .TP
  62. .BI "runfcgi [" "KEY=val" "] [" "KEY=val" "] " "..."
  63. Runs this project as a FastCGI application. Requires flup. Use
  64. .B runfcgi help
  65. for help on the KEY=val pairs.
  66. .TP
  67. .BI "runserver [" "\-\-noreload" "] [" "\-\-adminmedia=ADMIN_MEDIA_PATH" "] [" "port|ipaddr:port" "]"
  68. Starts a lightweight Web server for development.
  69. .TP
  70. .BI "shell [" "\-\-plain" "]"
  71. Runs a Python interactive interpreter. Tries to use IPython, if it's available.
  72. The
  73. .BI \-\-plain
  74. option forces the use of the standard Python interpreter even when IPython is
  75. installed.
  76. .TP
  77. .BI "sql [" "appname ..." "]"
  78. Prints the CREATE TABLE SQL statements for the given app name(s).
  79. .TP
  80. .BI "sqlall [" "appname ..." "]"
  81. Prints the CREATE TABLE, initial\-data and CREATE INDEX SQL statements for the
  82. given model module name(s).
  83. .TP
  84. .BI "sqlclear [" "appname ..." "]"
  85. Prints the DROP TABLE SQL statements for the given app name(s).
  86. .TP
  87. .BI "sqlindexes [" "appname ..." "]"
  88. Prints the CREATE INDEX SQL statements for the given model module name(s).
  89. .TP
  90. .BI "sqlinitialdata [" "appname ..." "]"
  91. Prints the initial INSERT SQL statements for the given app name(s).
  92. .TP
  93. .BI "sqlreset [" "appname ..." "]"
  94. Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app
  95. name(s).
  96. .TP
  97. .BI "sqlsequencereset [" "appname ..." "]"
  98. Prints the SQL statements for resetting PostgreSQL sequences for the
  99. given app name(s).
  100. .TP
  101. .BI "startapp [" "appname" "]"
  102. Creates a Django app directory structure for the given app name in
  103. the current directory.
  104. .TP
  105. .BI "startproject [" "projectname" "]"
  106. Creates a Django project directory structure for the given project name
  107. in the current directory.
  108. .TP
  109. .BI syncdb
  110. Creates the database tables for all apps in INSTALLED_APPS whose tables
  111. haven't already been created.
  112. .TP
  113. .BI "test [" "\-\-verbosity" "] [" "appname ..." "]"
  114. Runs the test suite for the specified applications, or the entire project if
  115. no apps are specified
  116. .TP
  117. .BI validate
  118. Validates all installed models.
  119. .SH "OPTIONS"
  120. .TP
  121. .I \-\-version
  122. Show program's version number and exit.
  123. .TP
  124. .I \-h, \-\-help
  125. Show this help message and exit.
  126. .TP
  127. .I \-\-settings=SETTINGS
  128. Python path to settings module, e.g. "myproject.settings.main". If
  129. this isn't provided, the DJANGO_SETTINGS_MODULE environment variable
  130. will be used.
  131. .TP
  132. .I \-\-pythonpath=PYTHONPATH
  133. Lets you manually add a directory the Python path,
  134. e.g. "/home/djangoprojects/myproject".
  135. .TP
  136. .I \-\-plain
  137. Use plain Python, not IPython, for the "shell" command.
  138. .TP
  139. .I \-\-noinput
  140. Do not prompt the user for input.
  141. .TP
  142. .I \-\-noreload
  143. Disable the development server's auto\-reloader.
  144. .TP
  145. .I \-\-verbosity=VERBOSITY
  146. Verbosity level: 0=minimal output, 1=normal output, 2=all output.
  147. .TP
  148. .I \-\-adminmedia=ADMIN_MEDIA_PATH
  149. Specifies the directory from which to serve admin media when using the development server.
  150. .TP
  151. .I \-l, \-\-locale=LOCALE
  152. The locale to process when using makemessages or compilemessages.
  153. .TP
  154. .I \-d, \-\-domain=DOMAIN
  155. The domain of the message files (default: "django") when using makemessages.
  156. .TP
  157. .I \-a, \-\-all
  158. Process all available locales when using makemessages.
  159. .SH "ENVIRONMENT"
  160. .TP
  161. .I DJANGO_SETTINGS_MODULE
  162. In the absence of the
  163. .BI \-\-settings
  164. option, this environment variable defines the settings module to be read.
  165. It should be in Python-import form, e.g. "myproject.settings".
  166. .SH "SEE ALSO"
  167. Full descriptions of all these options, with examples, as well as documentation
  168. for the rest of the Django framework, can be found on the Django site:
  169. .sp
  170. .I http://www.djangoproject.com/documentation/
  171. .sp
  172. or in the distributed documentation.
  173. .SH "AUTHORS/CREDITS"
  174. Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
  175. AUTHORS file in the Django distribution for contributors.
  176. .sp
  177. .SH "LICENSE"
  178. New BSD license. For the full license text refer to the LICENSE file in the
  179. Django distribution.