django-admin.1 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  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 "runfcgi [" "KEY=val" "] [" "KEY=val" "] " "..."
  68. Runs this project as a FastCGI application. Requires flup. Use
  69. .B runfcgi help
  70. for help on the KEY=val pairs.
  71. .TP
  72. .BI "runserver [" "\-\-noreload" "] [" "\-\-nothreading" "] [" "\-\-nostatic" "] [" "\-\-insecure" "] [" "\-\-ipv6" "] [" "port|ipaddr:port" "]"
  73. Starts a lightweight Web server for development.
  74. .TP
  75. .BI "shell [" "\-\-plain" "]"
  76. Runs a Python interactive interpreter. Tries to use IPython, if it's available.
  77. The
  78. .BI \-\-plain
  79. option forces the use of the standard Python interpreter even when IPython is
  80. installed.
  81. .TP
  82. .BI "sql [" "app_label ..." "]"
  83. Prints the CREATE TABLE SQL statements for the given app name(s).
  84. .TP
  85. .BI "sqlall [" "app_label ..." "]"
  86. Prints the CREATE TABLE, initial\-data and CREATE INDEX SQL statements for the
  87. given model module name(s).
  88. .TP
  89. .BI "sqlclear [" "app_label ..." "]"
  90. Prints the DROP TABLE SQL statements for the given app name(s).
  91. .TP
  92. .BI "sqlcustom [" "app_label ..." "]"
  93. Prints the custom SQL statements for the given app name(s).
  94. .TP
  95. .BI "sqlflush [" "app_label ..." "]"
  96. Prints the SQL statements that would be executed for the "flush" command.
  97. .TP
  98. .BI "sqlindexes [" "app_label ..." "]"
  99. Prints the CREATE INDEX SQL statements for the given model module name(s).
  100. .TP
  101. .BI "sqlsequencereset [" "app_label ..." "]"
  102. Prints the SQL statements for resetting PostgreSQL sequences for the
  103. given app name(s).
  104. .TP
  105. .BI "startapp [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "app_label" "] [" "destination" "]"
  106. Creates a Django app directory structure for the given app name in
  107. the current directory or the optional destination.
  108. .TP
  109. .BI "startproject [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "projectname" "] [" "destination" "]"
  110. Creates a Django project directory structure for the given project name
  111. in the current directory or the optional destination.
  112. .TP
  113. .BI migrate
  114. Runs migrations for apps containing migrations, and just creates missing tables
  115. for apps without migrations.
  116. .TP
  117. .BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "app_label ..." "]"
  118. Runs the test suite for the specified applications, or the entire project if
  119. no apps are specified
  120. .TP
  121. .BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
  122. Runs the test suite for the specified applications, or the entire project if
  123. no apps are specified
  124. .TP
  125. .BI validate
  126. Validates all installed models.
  127. .SH "OPTIONS"
  128. .TP
  129. .I \-\-version
  130. Show program's version number and exit.
  131. .TP
  132. .I \-h, \-\-help
  133. Show this help message and exit.
  134. .TP
  135. .I \-\-settings=SETTINGS
  136. Python path to settings module, e.g. "myproject.settings.main". If
  137. this isn't provided, the DJANGO_SETTINGS_MODULE environment variable
  138. will be used.
  139. .TP
  140. .I \-\-pythonpath=PYTHONPATH
  141. Lets you manually add a directory the Python path,
  142. e.g. "/home/djangoprojects/myproject".
  143. .TP
  144. .I \-\-plain
  145. Use plain Python, not IPython, for the "shell" command.
  146. .TP
  147. .I \-\-noinput
  148. Do not prompt the user for input.
  149. .TP
  150. .I \-\-noreload
  151. Disable the development server's auto\-reloader.
  152. .TP
  153. .I \-\-nostatic
  154. Disable automatic serving of static files from STATIC_URL.
  155. .TP
  156. .I \-\-nothreading
  157. Disable the development server's threading.
  158. .TP
  159. .I \-\-insecure
  160. Enables serving of static files even if DEBUG is False.
  161. .TP
  162. .I \-\-ipv6
  163. Enables IPv6 addresses.
  164. .TP
  165. .I \-\-verbosity=VERBOSITY
  166. Verbosity level: 0=minimal output, 1=normal output, 2=all output.
  167. .TP
  168. .I \-\-traceback
  169. By default, django-admin will show a simple error message whenever an
  170. error occurs. If you specify this option, django-admin will
  171. output a full stack trace whenever an exception is raised.
  172. .TP
  173. .I \-l, \-\-locale=LOCALE
  174. The locale to process when using makemessages or compilemessages.
  175. .TP
  176. .I \-x, \-\-exclude=LOCALE
  177. The locale to exclude from processing when using makemessages or compilemessages.
  178. .TP
  179. .I \-d, \-\-domain=DOMAIN
  180. The domain of the message files (default: "django") when using makemessages.
  181. .TP
  182. .I \-e, \-\-extension=EXTENSION
  183. The file extension(s) to examine (separate multiple
  184. extensions with commas, or use \-e multiple times) (makemessages command).
  185. .TP
  186. .I \-s, \-\-symlinks
  187. Follows symlinks to directories when examining source code and templates for
  188. translation strings (makemessages command).
  189. .TP
  190. .I \-i, \-\-ignore=PATTERN
  191. Ignore files or directories matching this glob-style pattern. Use multiple
  192. times to ignore more (makemessages command).
  193. .TP
  194. .I \-\-no\-default\-ignore
  195. Don't ignore the common private glob-style patterns 'CVS', '.*', '*~' and '*.pyc'
  196. (makemessages command).
  197. .TP
  198. .I \-\-no\-wrap
  199. Don't break long message lines into several lines (makemessages command).
  200. .TP
  201. .I \-\-no\-location
  202. Don't write '#: filename:line' comment lines in language files (makemessages command).
  203. .TP
  204. .I \-a, \-\-all
  205. Process all available locales when using makemessages.
  206. .TP
  207. .I \-\-template=PATH_OR_URL
  208. The file or directory path or URL to load the project and app templates from.
  209. .TP
  210. .I \-n, \-\-name=FILENAME
  211. The name of an additional file to render when using app and project templates.
  212. .TP
  213. .I \-\-database=DB
  214. Used to specify the database on which a command will operate. If not
  215. specified, this option will default to an alias of "default".
  216. .SH "ENVIRONMENT"
  217. .TP
  218. .I DJANGO_SETTINGS_MODULE
  219. In the absence of the
  220. .BI \-\-settings
  221. option, this environment variable defines the settings module to be read.
  222. It should be in Python-import form, e.g. "myproject.settings".
  223. .SH "SEE ALSO"
  224. Full descriptions of all these options, with examples, as well as documentation
  225. for the rest of the Django framework, can be found on the Django site:
  226. .sp
  227. .I http://docs.djangoproject.com/en/dev/
  228. .sp
  229. or in the distributed documentation.
  230. .SH "AUTHORS/CREDITS"
  231. Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
  232. AUTHORS file in the Django distribution for contributors.
  233. .sp
  234. .SH "LICENSE"
  235. New BSD license. For the full license text refer to the LICENSE file in the
  236. Django distribution.