django-admin.1 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  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 "sql [" "app_label ..." "]"
  78. Prints the CREATE TABLE SQL statements for the given app name(s).
  79. .TP
  80. .BI "sqlall [" "app_label ..." "]"
  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 [" "app_label ..." "]"
  85. Prints the DROP TABLE SQL statements for the given app name(s).
  86. .TP
  87. .BI "sqlflush [" "app_label ..." "]"
  88. Prints the SQL statements that would be executed for the "flush" command.
  89. .TP
  90. .BI "sqlindexes [" "app_label ..." "]"
  91. Prints the CREATE INDEX SQL statements for the given model module name(s).
  92. .TP
  93. .BI "sqlsequencereset [" "app_label ..." "]"
  94. Prints the SQL statements for resetting PostgreSQL sequences for the
  95. given app name(s).
  96. .TP
  97. .BI "startapp [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "app_label" "] [" "destination" "]"
  98. Creates a Django app directory structure for the given app name in
  99. the current directory or the optional destination.
  100. .TP
  101. .BI "startproject [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "projectname" "] [" "destination" "]"
  102. Creates a Django project directory structure for the given project name
  103. in the current directory or the optional destination.
  104. .TP
  105. .BI migrate
  106. Runs migrations for apps containing migrations, and just creates missing tables
  107. for apps without migrations.
  108. .TP
  109. .BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "app_label ..." "]"
  110. Runs the test suite for the specified applications, or the entire project if
  111. no apps are specified
  112. .TP
  113. .BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
  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 \-\-nostatic
  146. Disable automatic serving of static files from STATIC_URL.
  147. .TP
  148. .I \-\-nothreading
  149. Disable the development server's threading.
  150. .TP
  151. .I \-\-insecure
  152. Enables serving of static files even if DEBUG is False.
  153. .TP
  154. .I \-\-ipv6
  155. Enables IPv6 addresses.
  156. .TP
  157. .I \-\-verbosity=VERBOSITY
  158. Verbosity level: 0=minimal output, 1=normal output, 2=all output.
  159. .TP
  160. .I \-\-traceback
  161. By default, django-admin will show a simple error message whenever an
  162. error occurs. If you specify this option, django-admin will
  163. output a full stack trace whenever an exception is raised.
  164. .TP
  165. .I \-l, \-\-locale=LOCALE
  166. The locale to process when using makemessages or compilemessages.
  167. .TP
  168. .I \-x, \-\-exclude=LOCALE
  169. The locale to exclude from processing when using makemessages or compilemessages.
  170. .TP
  171. .I \-d, \-\-domain=DOMAIN
  172. The domain of the message files (default: "django") when using makemessages.
  173. .TP
  174. .I \-e, \-\-extension=EXTENSION
  175. The file extension(s) to examine (separate multiple
  176. extensions with commas, or use \-e multiple times) (makemessages command).
  177. .TP
  178. .I \-s, \-\-symlinks
  179. Follows symlinks to directories when examining source code and templates for
  180. translation strings (makemessages command).
  181. .TP
  182. .I \-i, \-\-ignore=PATTERN
  183. Ignore files or directories matching this glob-style pattern. Use multiple
  184. times to ignore more (makemessages command).
  185. .TP
  186. .I \-\-no\-default\-ignore
  187. Don't ignore the common private glob-style patterns 'CVS', '.*', '*~' and '*.pyc'
  188. (makemessages command).
  189. .TP
  190. .I \-\-no\-wrap
  191. Don't break long message lines into several lines (makemessages command).
  192. .TP
  193. .I \-\-no\-location
  194. Don't write '#: filename:line' comment lines in language files (makemessages command).
  195. .TP
  196. .I \-a, \-\-all
  197. Process all available locales when using makemessages.
  198. .TP
  199. .I \-\-template=PATH_OR_URL
  200. The file or directory path or URL to load the project and app templates from.
  201. .TP
  202. .I \-n, \-\-name=FILENAME
  203. The name of an additional file to render when using app and project templates.
  204. .TP
  205. .I \-\-database=DB
  206. Used to specify the database on which a command will operate. If not
  207. specified, this option will default to an alias of "default".
  208. .SH "ENVIRONMENT"
  209. .TP
  210. .I DJANGO_SETTINGS_MODULE
  211. In the absence of the
  212. .BI \-\-settings
  213. option, this environment variable defines the settings module to be read.
  214. It should be in Python-import form, e.g. "myproject.settings".
  215. .SH "SEE ALSO"
  216. Full descriptions of all these options, with examples, as well as documentation
  217. for the rest of the Django framework, can be found on the Django site:
  218. .sp
  219. .I http://docs.djangoproject.com/en/dev/
  220. .sp
  221. or in the distributed documentation.
  222. .SH "AUTHORS/CREDITS"
  223. Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
  224. AUTHORS file in the Django distribution for contributors.
  225. .sp
  226. .SH "LICENSE"
  227. New BSD license. For the full license text refer to the LICENSE file in the
  228. Django distribution.