1django-admin.py(1) django-admin.py(1)
2
3
4
6 django-admin.py - Utility script for the Django Web framework
7
9 django-admin.py <action> [options]
10
11
13 This utility script provides commands for creation and maintenance of
14 Django projects and apps.
15
16 With the exception of startproject, all commands listed below can also
17 be performed with the manage.py script found at the top level of each
18 Django project directory.
19
20
22 cleanup
23 Cleans out old data from the database (only expired sessions at
24 the moment).
25
26 compilemessages [--locale=LOCALE]
27 Compiles .po files to .mo files for use with builtin gettext
28 support.
29
30 createcachetable [tablename]
31 Creates the table needed to use the SQL cache backend
32
33 createsuperuser [--username=USERNAME] [--email=EMAIL]
34 Creates a superuser account (a user who has all permissions).
35
36 dbshell
37 Runs the command-line client for the specified databaseENGINE.
38
39 diffsettings
40 Displays differences between the current settings.py and
41 Django's default settings. Settings that don't appear in the
42 defaults are followed by "###".
43
44 dumpdata [--all] [--format=FMT] [--indent=NUM] [--natural=NATURAL]
45 [appname appname appname.Model ...]
46 Outputs to standard output all data in the database associated
47 with the named application(s).
48
49 flush Returns the database to the state it was in immediately after
50 syncdb was executed.
51
52 inspectdb
53 Introspects the database tables in the database specified in
54 settings.py and outputs a Django model module.
55
56 loaddata [fixture fixture ...]
57 Searches for and loads the contents of the named fixture into
58 the database.
59
60 install [appname ...]
61 Executes sqlall for the given app(s) in the current database.
62
63 makemessages [--locale=LOCALE] [--domain=DOMAIN] [--extension=EXTEN‐
64 SION] [--all] [--symlinks] [--ignore=PATTERN] [--no-default-ignore]
65 [--no-wrap]
66 Runs over the entire source tree of the current directory and
67 pulls out all strings marked for translation. It creates (or
68 updates) a message file in the conf/locale (in the django tree)
69 or locale (for project and application) directory.
70
71 reset [appname ...]
72 Executes sqlreset for the given app(s) in the current database.
73
74 runfcgi [KEY=val] [KEY=val] ...
75 Runs this project as a FastCGI application. Requires flup. Use
76 runfcgi help for help on the KEY=val pairs.
77
78 runserver [--noreload] [--nostatic] [--insecure] [--ipv6] [--admin‐
79 media=ADMIN_MEDIA_PATH] [port|ipaddr:port]
80 Starts a lightweight Web server for development.
81
82 shell [--plain]
83 Runs a Python interactive interpreter. Tries to use IPython, if
84 it's available. The --plain option forces the use of the stan‐
85 dard Python interpreter even when IPython is installed.
86
87 sql [appname ...]
88 Prints the CREATE TABLE SQL statements for the given app
89 name(s).
90
91 sqlall [appname ...]
92 Prints the CREATE TABLE, initial-data and CREATE INDEX SQL
93 statements for the given model module name(s).
94
95 sqlclear [appname ...]
96 Prints the DROP TABLE SQL statements for the given app name(s).
97
98 sqlcustom [appname ...]
99 Prints the custom SQL statements for the given app name(s).
100
101 sqlflush [appname ...]
102 Prints the SQL statements that would be executed for the "flush"
103 command.
104
105 sqlindexes [appname ...]
106 Prints the CREATE INDEX SQL statements for the given model mod‐
107 ule name(s).
108
109 sqlinitialdata [appname ...]
110 Prints the initial INSERT SQL statements for the given app
111 name(s).
112
113 sqlreset [appname ...]
114 Prints the DROP TABLE SQL, then the CREATE TABLE SQL, for the
115 given app name(s).
116
117 sqlsequencereset [appname ...]
118 Prints the SQL statements for resetting PostgreSQL sequences for
119 the given app name(s).
120
121 startapp [appname]
122 Creates a Django app directory structure for the given app name
123 in the current directory.
124
125 startproject [projectname]
126 Creates a Django project directory structure for the given
127 project name in the current directory.
128
129 syncdb Creates the database tables for all apps in INSTALLED_APPS whose
130 tables haven't already been created.
131
132 test [--verbosity] [--failfast] [appname ...]
133 Runs the test suite for the specified applications, or the
134 entire project if no apps are specified
135
136 testserver [--addrport=ipaddr|port] [fixture fixture ...]
137 Runs the test suite for the specified applications, or the
138 entire project if no apps are specified
139
140 validate
141 Validates all installed models.
142
144 --version
145 Show program's version number and exit.
146
147 -h, --help
148 Show this help message and exit.
149
150 --settings=SETTINGS
151 Python path to settings module, e.g. "myproject.settings.main".
152 If this isn't provided, the DJANGO_SETTINGS_MODULE environment
153 variable will be used.
154
155 --pythonpath=PYTHONPATH
156 Lets you manually add a directory the Python path, e.g.
157 "/home/djangoprojects/myproject".
158
159 --plain
160 Use plain Python, not IPython, for the "shell" command.
161
162 --noinput
163 Do not prompt the user for input.
164
165 --noreload
166 Disable the development server's auto-reloader.
167
168 --nostatic
169 Disable automatic serving of static files from STATIC_URL.
170
171 --insecure
172 Enables serving of static files even if DEBUG is False.
173
174 --ipv6 Enables IPv6 addresses.
175
176 --verbosity=VERBOSITY
177 Verbosity level: 0=minimal output, 1=normal output, 2=all out‐
178 put.
179
180 --adminmedia=ADMIN_MEDIA_PATH
181 Specifies the directory from which to serve admin media when
182 using the development server.
183
184 --traceback
185 By default, django-admin.py will show a simple error message
186 whenever an error occurs. If you specify this option, django-
187 admin.py will output a full stack trace whenever an exception
188 is raised.
189
190 -l, --locale=LOCALE
191 The locale to process when using makemessages or compilemes‐
192 sages.
193
194 -d, --domain=DOMAIN
195 The domain of the message files (default: "django") when using
196 makemessages.
197
198 -e, --extension=EXTENSION
199 The file extension(s) to examine (default: ".html", separate
200 multiple extensions with commas, or use -e multiple times).
201
202 -s, --symlinks
203 Follows symlinks to directories when examining source code and
204 templates for translation strings.
205
206 -i, --ignore=PATTERN
207 Ignore files or directories matching this glob-style pattern.
208 Use multiple times to ignore more.
209
210 --no-default-ignore
211 Don't ignore the common private glob-style patterns 'CVS', '.*'
212 and '*~'.
213
214 --no-wrap
215 Don't break long message lines into several lines.
216
217 -a, --all
218 Process all available locales when using makemessages..SH "ENVI‐
219 RONMENT"
220
221 DJANGO_SETTINGS_MODULE
222 In the absence of the --settings option, this environment vari‐
223 able defines the settings module to be read. It should be in
224 Python-import form, e.g. "myproject.settings". --database=DB
225 Used to specify the database on which a command will operate. If
226 not specified, this option will default to an alias of
227 "default".
228
229
230
231 SEE ALSO
232 Full descriptions of all these options, with examples, as well
233 as documentation for the rest of the Django framework, can be
234 found on the Django site:
235
236 http://docs.djangoproject.com/en/dev/
237
238 or in the distributed documentation.
239
241 Originally developed at World Online in Lawrence, Kansas, USA. Refer to
242 the AUTHORS file in the Django distribution for contributors.
243
244
246 New BSD license. For the full license text refer to the LICENSE file in
247 the Django distribution.
248
249
250
251
252Django Project March 2008 django-admin.py(1)