django-admin.1 6.1 KB

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