/docs/man/django-admin.1

https://code.google.com/p/mango-py/ · Unknown · 238 lines · 236 code · 2 blank · 0 comment · 0 complexity · ff7a0c35694071b30e9508f2c3800ab3 MD5 · raw file

  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. .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" "] [" "appname appname appname.Model ..." "]"
  44. Outputs to standard output all data in the database associated with the named
  45. application(s).
  46. .TP
  47. .BI flush
  48. Returns the database to the state it was in immediately after syncdb was
  49. executed.
  50. .TP
  51. .B inspectdb
  52. Introspects the database tables in the database specified in settings.py and outputs a Django
  53. model module.
  54. .TP
  55. .BI "loaddata [" "fixture fixture ..." "]"
  56. Searches for and loads the contents of the named fixture into the database.
  57. .TP
  58. .BI "install [" "appname ..." "]"
  59. Executes
  60. .B sqlall
  61. for the given app(s) in the current database.
  62. .TP
  63. .BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "] [" "\-\-symlinks" "] [" "\-\-ignore=PATTERN" "] [" "\-\-no\-default\-ignore" "] [" "\-\-no\-wrap" "]"
  64. Runs over the entire source tree of the current directory and pulls out all
  65. strings marked for translation. It creates (or updates) a message file in the
  66. conf/locale (in the django tree) or locale (for project and application) directory.
  67. .TP
  68. .BI "reset [" "appname ..." "]"
  69. Executes
  70. .B sqlreset
  71. for the given app(s) in the current database.
  72. .TP
  73. .BI "runfcgi [" "KEY=val" "] [" "KEY=val" "] " "..."
  74. Runs this project as a FastCGI application. Requires flup. Use
  75. .B runfcgi help
  76. for help on the KEY=val pairs.
  77. .TP
  78. .BI "runserver [" "\-\-noreload" "] [" "\-\-nostatic" "] [" "\-\-insecure" "] [" "\-\-ipv6" "] [" "\-\-adminmedia=ADMIN_MEDIA_PATH" "] [" "port|ipaddr:port" "]"
  79. Starts a lightweight Web server for development.
  80. .TP
  81. .BI "shell [" "\-\-plain" "]"
  82. Runs a Python interactive interpreter. Tries to use IPython, if it's available.
  83. The
  84. .BI \-\-plain
  85. option forces the use of the standard Python interpreter even when IPython is
  86. installed.
  87. .TP
  88. .BI "sql [" "appname ..." "]"
  89. Prints the CREATE TABLE SQL statements for the given app name(s).
  90. .TP
  91. .BI "sqlall [" "appname ..." "]"
  92. Prints the CREATE TABLE, initial\-data and CREATE INDEX SQL statements for the
  93. given model module name(s).
  94. .TP
  95. .BI "sqlclear [" "appname ..." "]"
  96. Prints the DROP TABLE SQL statements for the given app name(s).
  97. .TP
  98. .BI "sqlcustom [" "appname ..." "]"
  99. Prints the custom SQL statements for the given app name(s).
  100. .TP
  101. .BI "sqlflush [" "appname ..." "]"
  102. Prints the SQL statements that would be executed for the "flush"
  103. command.
  104. .TP
  105. .BI "sqlindexes [" "appname ..." "]"
  106. Prints the CREATE INDEX SQL statements for the given model module name(s).
  107. .TP
  108. .BI "sqlinitialdata [" "appname ..." "]"
  109. Prints the initial INSERT SQL statements for the given app name(s).
  110. .TP
  111. .BI "sqlreset [" "appname ..." "]"
  112. Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app
  113. name(s).
  114. .TP
  115. .BI "sqlsequencereset [" "appname ..." "]"
  116. Prints the SQL statements for resetting PostgreSQL sequences for the
  117. given app name(s).
  118. .TP
  119. .BI "startapp [" "appname" "]"
  120. Creates a Django app directory structure for the given app name in
  121. the current directory.
  122. .TP
  123. .BI "startproject [" "projectname" "]"
  124. Creates a Django project directory structure for the given project name
  125. in the current directory.
  126. .TP
  127. .BI syncdb
  128. Creates the database tables for all apps in INSTALLED_APPS whose tables
  129. haven't already been created.
  130. .TP
  131. .BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "appname ..." "]"
  132. Runs the test suite for the specified applications, or the entire project if
  133. no apps are specified
  134. .TP
  135. .BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
  136. Runs the test suite for the specified applications, or the entire project if
  137. no apps are specified
  138. .TP
  139. .BI validate
  140. Validates all installed models.
  141. .SH "OPTIONS"
  142. .TP
  143. .I \-\-version
  144. Show program's version number and exit.
  145. .TP
  146. .I \-h, \-\-help
  147. Show this help message and exit.
  148. .TP
  149. .I \-\-settings=SETTINGS
  150. Python path to settings module, e.g. "myproject.settings.main". If
  151. this isn't provided, the DJANGO_SETTINGS_MODULE environment variable
  152. will be used.
  153. .TP
  154. .I \-\-pythonpath=PYTHONPATH
  155. Lets you manually add a directory the Python path,
  156. e.g. "/home/djangoprojects/myproject".
  157. .TP
  158. .I \-\-plain
  159. Use plain Python, not IPython, for the "shell" command.
  160. .TP
  161. .I \-\-noinput
  162. Do not prompt the user for input.
  163. .TP
  164. .I \-\-noreload
  165. Disable the development server's auto\-reloader.
  166. .TP
  167. .I \-\-nostatic
  168. Disable automatic serving of static files from STATIC_URL.
  169. .TP
  170. .I \-\-insecure
  171. Enables serving of static files even if DEBUG is False.
  172. .TP
  173. .I \-\-ipv6
  174. Enables IPv6 addresses.
  175. .TP
  176. .I \-\-verbosity=VERBOSITY
  177. Verbosity level: 0=minimal output, 1=normal output, 2=all output.
  178. .TP
  179. .I \-\-adminmedia=ADMIN_MEDIA_PATH
  180. Specifies the directory from which to serve admin media when using the development server.
  181. .TP
  182. .I \-\-traceback
  183. By default, django-admin.py will show a simple error message whenever an
  184. error occurs. If you specify this option, django-admin.py will
  185. output a full stack trace whenever an exception is raised.
  186. .TP
  187. .I \-l, \-\-locale=LOCALE
  188. The locale to process when using makemessages or compilemessages.
  189. .TP
  190. .I \-d, \-\-domain=DOMAIN
  191. The domain of the message files (default: "django") when using makemessages.
  192. .TP
  193. .I \-e, \-\-extension=EXTENSION
  194. The file extension(s) to examine (default: ".html", separate multiple
  195. extensions with commas, or use -e multiple times).
  196. .TP
  197. .I \-s, \-\-symlinks
  198. Follows symlinks to directories when examining source code and templates for
  199. translation strings.
  200. .TP
  201. .I \-i, \-\-ignore=PATTERN
  202. Ignore files or directories matching this glob-style pattern. Use multiple
  203. times to ignore more.
  204. .TP
  205. .I \-\-no\-default\-ignore
  206. Don't ignore the common private glob-style patterns 'CVS', '.*' and '*~'.
  207. .TP
  208. .I \-\-no\-wrap
  209. Don't break long message lines into several lines.
  210. .TP
  211. .I \-a, \-\-all
  212. Process all available locales when using makemessages..SH "ENVIRONMENT"
  213. .TP
  214. .I DJANGO_SETTINGS_MODULE
  215. In the absence of the
  216. .BI \-\-settings
  217. option, this environment variable defines the settings module to be read.
  218. It should be in Python-import form, e.g. "myproject.settings".
  219. .I \-\-database=DB
  220. Used to specify the database on which a command will operate. If not
  221. specified, this option will default to an alias of "default".
  222. .TP
  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.