| 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 |
.B dbshell |
|---|
| 31 |
Runs the command\-line client for the current |
|---|
| 32 |
.BI DATABASE_ENGINE. |
|---|
| 33 |
.TP |
|---|
| 34 |
.B diffsettings |
|---|
| 35 |
Displays differences between the current |
|---|
| 36 |
.B settings.py |
|---|
| 37 |
and Django's default settings. Settings that don't appear in the defaults are |
|---|
| 38 |
followed by "###". |
|---|
| 39 |
.TP |
|---|
| 40 |
.B inspectdb |
|---|
| 41 |
Introspects the database tables in the database specified in settings.py and outputs a Django |
|---|
| 42 |
model module. |
|---|
| 43 |
.TP |
|---|
| 44 |
.BI "install [" "appname ..." "]" |
|---|
| 45 |
Executes |
|---|
| 46 |
.B sqlall |
|---|
| 47 |
for the given app(s) in the current database. |
|---|
| 48 |
.TP |
|---|
| 49 |
.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "]" |
|---|
| 50 |
Runs over the entire source tree of the current directory and pulls out all |
|---|
| 51 |
strings marked for translation. It creates (or updates) a message file in the |
|---|
| 52 |
conf/locale (in the django tree) or locale (for project and application) directory. |
|---|
| 53 |
.TP |
|---|
| 54 |
.BI "reset [" "appname ..." "]" |
|---|
| 55 |
Executes |
|---|
| 56 |
.B sqlreset |
|---|
| 57 |
for the given app(s) in the current database. |
|---|
| 58 |
.TP |
|---|
| 59 |
.BI "runfcgi [" "KEY=val" "] [" "KEY=val" "] " "..." |
|---|
| 60 |
Runs this project as a FastCGI application. Requires flup. Use |
|---|
| 61 |
.B runfcgi help |
|---|
| 62 |
for help on the KEY=val pairs. |
|---|
| 63 |
.TP |
|---|
| 64 |
.BI "runserver [" "\-\-noreload" "] [" "\-\-adminmedia=ADMIN_MEDIA_PATH" "] [" "port|ipaddr:port" "]" |
|---|
| 65 |
Starts a lightweight Web server for development. |
|---|
| 66 |
.TP |
|---|
| 67 |
.BI "shell [" "\-\-plain" "]" |
|---|
| 68 |
Runs a Python interactive interpreter. Tries to use IPython, if it's available. |
|---|
| 69 |
The |
|---|
| 70 |
.BI \-\-plain |
|---|
| 71 |
option forces the use of the standard Python interpreter even when IPython is |
|---|
| 72 |
installed. |
|---|
| 73 |
.TP |
|---|
| 74 |
.BI "sql [" "appname ..." "]" |
|---|
| 75 |
Prints the CREATE TABLE SQL statements for the given app name(s). |
|---|
| 76 |
.TP |
|---|
| 77 |
.BI "sqlall [" "appname ..." "]" |
|---|
| 78 |
Prints the CREATE TABLE, initial\-data and CREATE INDEX SQL statements for the |
|---|
| 79 |
given model module name(s). |
|---|
| 80 |
.TP |
|---|
| 81 |
.BI "sqlclear [" "appname ..." "]" |
|---|
| 82 |
Prints the DROP TABLE SQL statements for the given app name(s). |
|---|
| 83 |
.TP |
|---|
| 84 |
.BI "sqlindexes [" "appname ..." "]" |
|---|
| 85 |
Prints the CREATE INDEX SQL statements for the given model module name(s). |
|---|
| 86 |
.TP |
|---|
| 87 |
.BI "sqlinitialdata [" "appname ..." "]" |
|---|
| 88 |
Prints the initial INSERT SQL statements for the given app name(s). |
|---|
| 89 |
.TP |
|---|
| 90 |
.BI "sqlreset [" "appname ..." "]" |
|---|
| 91 |
Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the given app |
|---|
| 92 |
name(s). |
|---|
| 93 |
.TP |
|---|
| 94 |
.BI "sqlsequencereset [" "appname ..." "]" |
|---|
| 95 |
Prints the SQL statements for resetting PostgreSQL sequences for the |
|---|
| 96 |
given app name(s). |
|---|
| 97 |
.TP |
|---|
| 98 |
.BI "startapp [" "appname" "]" |
|---|
| 99 |
Creates a Django app directory structure for the given app name in |
|---|
| 100 |
the current directory. |
|---|
| 101 |
.TP |
|---|
| 102 |
.BI "startproject [" "projectname" "]" |
|---|
| 103 |
Creates a Django project directory structure for the given project name |
|---|
| 104 |
in the current directory. |
|---|
| 105 |
.TP |
|---|
| 106 |
.BI syncdb |
|---|
| 107 |
Creates the database tables for all apps in INSTALLED_APPS whose tables |
|---|
| 108 |
haven't already been created. |
|---|
| 109 |
.TP |
|---|
| 110 |
.BI "test [" "\-\-verbosity" "] [" "appname ..." "]" |
|---|
| 111 |
Runs the test suite for the specified applications, or the entire project if |
|---|
| 112 |
no apps are specified |
|---|
| 113 |
.TP |
|---|
| 114 |
.BI validate |
|---|
| 115 |
Validates all installed models. |
|---|
| 116 |
.SH "OPTIONS" |
|---|
| 117 |
.TP |
|---|
| 118 |
.I \-\-version |
|---|
| 119 |
Show program's version number and exit. |
|---|
| 120 |
.TP |
|---|
| 121 |
.I \-h, \-\-help |
|---|
| 122 |
Show this help message and exit. |
|---|
| 123 |
.TP |
|---|
| 124 |
.I \-\-settings=SETTINGS |
|---|
| 125 |
Python path to settings module, e.g. "myproject.settings.main". If |
|---|
| 126 |
this isn't provided, the DJANGO_SETTINGS_MODULE environment variable |
|---|
| 127 |
will be used. |
|---|
| 128 |
.TP |
|---|
| 129 |
.I \-\-pythonpath=PYTHONPATH |
|---|
| 130 |
Lets you manually add a directory the Python path, |
|---|
| 131 |
e.g. "/home/djangoprojects/myproject". |
|---|
| 132 |
.TP |
|---|
| 133 |
.I \-\-plain |
|---|
| 134 |
Use plain Python, not IPython, for the "shell" command. |
|---|
| 135 |
.TP |
|---|
| 136 |
.I \-\-noinput |
|---|
| 137 |
Do not prompt the user for input. |
|---|
| 138 |
.TP |
|---|
| 139 |
.I \-\-noreload |
|---|
| 140 |
Disable the development server's auto\-reloader. |
|---|
| 141 |
.TP |
|---|
| 142 |
.I \-\-verbosity=VERBOSITY |
|---|
| 143 |
Verbosity level: 0=minimal output, 1=normal output, 2=all output. |
|---|
| 144 |
.TP |
|---|
| 145 |
.I \-\-adminmedia=ADMIN_MEDIA_PATH |
|---|
| 146 |
Specifies the directory from which to serve admin media when using the development server. |
|---|
| 147 |
.TP |
|---|
| 148 |
.I \-l, \-\-locale=LOCALE |
|---|
| 149 |
The locale to process when using makemessages or compilemessages. |
|---|
| 150 |
.TP |
|---|
| 151 |
.I \-d, \-\-domain=DOMAIN |
|---|
| 152 |
The domain of the message files (default: "django") when using makemessages. |
|---|
| 153 |
.TP |
|---|
| 154 |
.I \-e, \-\-extension=EXTENSION |
|---|
| 155 |
The file extension(s) to examine (default: ".html", separate multiple |
|---|
| 156 |
extensions with commas, or use -e multiple times). |
|---|
| 157 |
.TP |
|---|
| 158 |
.I \-a, \-\-all |
|---|
| 159 |
Process all available locales when using makemessages..SH "ENVIRONMENT" |
|---|
| 160 |
.TP |
|---|
| 161 |
.I DJANGO_SETTINGS_MODULE |
|---|
| 162 |
In the absence of the |
|---|
| 163 |
.BI \-\-settings |
|---|
| 164 |
option, this environment variable defines the settings module to be read. |
|---|
| 165 |
It should be in Python-import form, e.g. "myproject.settings". |
|---|
| 166 |
|
|---|
| 167 |
.SH "SEE ALSO" |
|---|
| 168 |
Full descriptions of all these options, with examples, as well as documentation |
|---|
| 169 |
for the rest of the Django framework, can be found on the Django site: |
|---|
| 170 |
.sp |
|---|
| 171 |
.I http://docs.djangoproject.com/en/dev/ |
|---|
| 172 |
.sp |
|---|
| 173 |
or in the distributed documentation. |
|---|
| 174 |
.SH "AUTHORS/CREDITS" |
|---|
| 175 |
Originally developed at World Online in Lawrence, Kansas, USA. Refer to the |
|---|
| 176 |
AUTHORS file in the Django distribution for contributors. |
|---|
| 177 |
.sp |
|---|
| 178 |
.SH "LICENSE" |
|---|
| 179 |
New BSD license. For the full license text refer to the LICENSE file in the |
|---|
| 180 |
Django distribution. |
|---|