django-admin.1 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. .TH "django-admin" "1" "March 2008" "Django Project" ""
  2. .SH "NAME"
  3. django\-admin \- Utility script for the Django Web framework
  4. .SH "SYNOPSIS"
  5. .B django\-admin
  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" "] [" "\-\-exclude=LOCALE" "] [" "\-\-use\-fuzzy" "]"
  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. .BI "createsuperuser [" "\-\-username=USERNAME" "] [" "\-\-email=EMAIL" "]"
  31. Creates a superuser account (a user who has all permissions).
  32. .TP
  33. .B dbshell
  34. Runs the command\-line client for the specified
  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. .BI "dumpdata [" "\-\-all" "] [" "\-\-format=FMT" "] [" "\-\-indent=NUM" "] [" "\-\-natural=NATURAL" "] [" "app_label app_label app_label.Model ..." "]"
  44. Outputs to standard output all data in the database associated with the named
  45. application(s).
  46. .TP
  47. .BI flush
  48. Removes all data from the database and then re-installs any initial data.
  49. .TP
  50. .B inspectdb
  51. Introspects the database tables in the database specified in settings.py and outputs a Django
  52. model module.
  53. .TP
  54. .BI "loaddata [" "fixture fixture ..." "]"
  55. Searches for and loads the contents of the named fixture into the database.
  56. .TP
  57. .BI "install [" "app_label ..." "]"
  58. Executes
  59. .B sqlall
  60. for the given app(s) in the current database.
  61. .TP
  62. .BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-exclude=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "] [" "\-\-symlinks" "] [" "\-\-ignore=PATTERN" "] [" "\-\-no\-default\-ignore" "] [" "\-\-no\-wrap" "] [" "\-\-no\-location" "]"
  63. Runs over the entire source tree of the current directory and pulls out all
  64. strings marked for translation. It creates (or updates) a message file in the
  65. conf/locale (in the django tree) or locale (for project and application) directory.
  66. .TP
  67. .BI "runserver [" "\-\-noreload" "] [" "\-\-nothreading" "] [" "\-\-nostatic" "] [" "\-\-insecure" "] [" "\-\-ipv6" "] [" "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 "sqlflush [" "app_label ..." "]"
  78. Prints the SQL statements that would be executed for the "flush" command.
  79. .TP
  80. .BI "sqlsequencereset [" "app_label ..." "]"
  81. Prints the SQL statements for resetting PostgreSQL sequences for the
  82. given app name(s).
  83. .TP
  84. .BI "startapp [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "app_label" "] [" "destination" "]"
  85. Creates a Django app directory structure for the given app name in
  86. the current directory or the optional destination.
  87. .TP
  88. .BI "startproject [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "projectname" "] [" "destination" "]"
  89. Creates a Django project directory structure for the given project name
  90. in the current directory or the optional destination.
  91. .TP
  92. .BI migrate
  93. Runs migrations for all apps.
  94. .TP
  95. .BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "app_label ..." "]"
  96. Runs the test suite for the specified applications, or the entire project if
  97. no apps are specified
  98. .TP
  99. .BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
  100. Runs the test suite for the specified applications, or the entire project if
  101. no apps are specified
  102. .SH "OPTIONS"
  103. .TP
  104. .I \-\-version
  105. Show program's version number and exit.
  106. .TP
  107. .I \-h, \-\-help
  108. Show this help message and exit.
  109. .TP
  110. .I \-\-settings=SETTINGS
  111. Python path to settings module, e.g. "myproject.settings.main". If
  112. this isn't provided, the DJANGO_SETTINGS_MODULE environment variable
  113. will be used.
  114. .TP
  115. .I \-\-pythonpath=PYTHONPATH
  116. Lets you manually add a directory the Python path,
  117. e.g. "/home/djangoprojects/myproject".
  118. .TP
  119. .I \-\-plain
  120. Use plain Python, not IPython, for the "shell" command.
  121. .TP
  122. .I \-\-noinput
  123. Do not prompt the user for input.
  124. .TP
  125. .I \-\-noreload
  126. Disable the development server's auto\-reloader.
  127. .TP
  128. .I \-\-nostatic
  129. Disable automatic serving of static files from STATIC_URL.
  130. .TP
  131. .I \-\-nothreading
  132. Disable the development server's threading.
  133. .TP
  134. .I \-\-insecure
  135. Enables serving of static files even if DEBUG is False.
  136. .TP
  137. .I \-\-ipv6
  138. Enables IPv6 addresses.
  139. .TP
  140. .I \-\-verbosity=VERBOSITY
  141. Verbosity level: 0=minimal output, 1=normal output, 2=all output.
  142. .TP
  143. .I \-\-traceback
  144. By default, django-admin will show a simple error message whenever an
  145. error occurs. If you specify this option, django-admin will
  146. output a full stack trace whenever an exception is raised.
  147. .TP
  148. .I \-l, \-\-locale=LOCALE
  149. The locale to process when using makemessages or compilemessages.
  150. .TP
  151. .I \-x, \-\-exclude=LOCALE
  152. The locale to exclude from processing 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 \-e, \-\-extension=EXTENSION
  158. The file extension(s) to examine (separate multiple
  159. extensions with commas, or use \-e multiple times) (makemessages command).
  160. .TP
  161. .I \-s, \-\-symlinks
  162. Follows symlinks to directories when examining source code and templates for
  163. translation strings (makemessages command).
  164. .TP
  165. .I \-i, \-\-ignore=PATTERN
  166. Ignore files or directories matching this glob-style pattern. Use multiple
  167. times to ignore more (makemessages command).
  168. .TP
  169. .I \-\-no\-default\-ignore
  170. Don't ignore the common private glob-style patterns 'CVS', '.*', '*~' and '*.pyc'
  171. (makemessages command).
  172. .TP
  173. .I \-\-no\-wrap
  174. Don't break long message lines into several lines (makemessages command).
  175. .TP
  176. .I \-\-no\-location
  177. Don't write '#: filename:line' comment lines in language files (makemessages command).
  178. .TP
  179. .I \-a, \-\-all
  180. Process all available locales when using makemessages.
  181. .TP
  182. .I \-\-template=PATH_OR_URL
  183. The file or directory path or URL to load the project and app templates from.
  184. .TP
  185. .I \-n, \-\-name=FILENAME
  186. The name of an additional file to render when using app and project templates.
  187. .TP
  188. .I \-\-database=DB
  189. Used to specify the database on which a command will operate. If not
  190. specified, this option will default to an alias of "default".
  191. .SH "ENVIRONMENT"
  192. .TP
  193. .I DJANGO_SETTINGS_MODULE
  194. In the absence of the
  195. .BI \-\-settings
  196. option, this environment variable defines the settings module to be read.
  197. It should be in Python-import form, e.g. "myproject.settings".
  198. .SH "SEE ALSO"
  199. Full descriptions of all these options, with examples, as well as documentation
  200. for the rest of the Django framework, can be found on the Django site:
  201. .sp
  202. .I http://docs.djangoproject.com/en/dev/
  203. .sp
  204. or in the distributed documentation.
  205. .SH "AUTHORS/CREDITS"
  206. Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
  207. AUTHORS file in the Django distribution for contributors.
  208. .sp
  209. .SH "LICENSE"
  210. New BSD license. For the full license text refer to the LICENSE file in the
  211. Django distribution.