django-admin.1 8.4 KB

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