2008-07-06 14:39:44 +08:00
|
|
|
.TH "django-admin.py" "1" "March 2008" "Django Project" ""
|
2007-06-10 14:33:31 +08:00
|
|
|
.SH "NAME"
|
2010-10-09 16:12:50 +08:00
|
|
|
django\-admin.py \- Utility script for the Django Web framework
|
2007-06-10 14:33:31 +08:00
|
|
|
.SH "SYNOPSIS"
|
|
|
|
.B django\-admin.py
|
|
|
|
.I <action>
|
|
|
|
.B [options]
|
|
|
|
.sp
|
|
|
|
.SH "DESCRIPTION"
|
|
|
|
This utility script provides commands for creation and maintenance of Django
|
|
|
|
projects and apps.
|
|
|
|
.sp
|
|
|
|
With the exception of
|
|
|
|
.BI startproject,
|
|
|
|
all commands listed below can also be performed with the
|
|
|
|
.BI manage.py
|
|
|
|
script found at the top level of each Django project directory.
|
|
|
|
.sp
|
|
|
|
.SH "ACTIONS"
|
|
|
|
.TP
|
2008-07-06 14:39:44 +08:00
|
|
|
.BI cleanup
|
|
|
|
Cleans out old data from the database (only expired sessions at the moment).
|
|
|
|
.TP
|
2014-03-24 21:03:06 +08:00
|
|
|
.BI "compilemessages [" "\-\-locale=LOCALE" "] [" "\-\-exclude=LOCALE" "]"
|
2008-07-06 14:39:44 +08:00
|
|
|
Compiles .po files to .mo files for use with builtin gettext support.
|
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.BI "createcachetable [" "tablename" "]"
|
|
|
|
Creates the table needed to use the SQL cache backend
|
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.BI "createsuperuser [" "\-\-username=USERNAME" "] [" "\-\-email=EMAIL" "]"
|
|
|
|
Creates a superuser account (a user who has all permissions).
|
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.B dbshell
|
2009-12-22 23:18:51 +08:00
|
|
|
Runs the command\-line client for the specified
|
|
|
|
.BI database ENGINE.
|
2007-06-10 14:33:31 +08:00
|
|
|
.TP
|
|
|
|
.B diffsettings
|
|
|
|
Displays differences between the current
|
|
|
|
.B settings.py
|
|
|
|
and Django's default settings. Settings that don't appear in the defaults are
|
|
|
|
followed by "###".
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "dumpdata [" "\-\-all" "] [" "\-\-format=FMT" "] [" "\-\-indent=NUM" "] [" "\-\-natural=NATURAL" "] [" "app_label app_label app_label.Model ..." "]"
|
2010-10-10 17:39:14 +08:00
|
|
|
Outputs to standard output all data in the database associated with the named
|
|
|
|
application(s).
|
|
|
|
.TP
|
|
|
|
.BI flush
|
2013-07-25 23:19:36 +08:00
|
|
|
Removes all data from the database and then re-installs any initial data.
|
2010-10-10 17:39:14 +08:00
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.B inspectdb
|
|
|
|
Introspects the database tables in the database specified in settings.py and outputs a Django
|
|
|
|
model module.
|
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.BI "loaddata [" "fixture fixture ..." "]"
|
|
|
|
Searches for and loads the contents of the named fixture into the database.
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "install [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Executes
|
|
|
|
.B sqlall
|
|
|
|
for the given app(s) in the current database.
|
|
|
|
.TP
|
2014-03-24 21:03:06 +08:00
|
|
|
.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-exclude=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "] [" "\-\-symlinks" "] [" "\-\-ignore=PATTERN" "] [" "\-\-no\-default\-ignore" "] [" "\-\-no\-wrap" "] [" "\-\-no\-location" "]"
|
2008-07-06 14:39:44 +08:00
|
|
|
Runs over the entire source tree of the current directory and pulls out all
|
|
|
|
strings marked for translation. It creates (or updates) a message file in the
|
|
|
|
conf/locale (in the django tree) or locale (for project and application) directory.
|
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.BI "runfcgi [" "KEY=val" "] [" "KEY=val" "] " "..."
|
|
|
|
Runs this project as a FastCGI application. Requires flup. Use
|
|
|
|
.B runfcgi help
|
|
|
|
for help on the KEY=val pairs.
|
|
|
|
.TP
|
2012-04-09 05:13:32 +08:00
|
|
|
.BI "runserver [" "\-\-noreload" "] [" "\-\-nothreading" "] [" "\-\-nostatic" "] [" "\-\-insecure" "] [" "\-\-ipv6" "] [" "port|ipaddr:port" "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Starts a lightweight Web server for development.
|
|
|
|
.TP
|
|
|
|
.BI "shell [" "\-\-plain" "]"
|
|
|
|
Runs a Python interactive interpreter. Tries to use IPython, if it's available.
|
|
|
|
The
|
|
|
|
.BI \-\-plain
|
|
|
|
option forces the use of the standard Python interpreter even when IPython is
|
|
|
|
installed.
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sql [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Prints the CREATE TABLE SQL statements for the given app name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlall [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Prints the CREATE TABLE, initial\-data and CREATE INDEX SQL statements for the
|
|
|
|
given model module name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlclear [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Prints the DROP TABLE SQL statements for the given app name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlcustom [" "app_label ..." "]"
|
2010-10-10 17:39:14 +08:00
|
|
|
Prints the custom SQL statements for the given app name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlflush [" "app_label ..." "]"
|
2011-12-23 06:38:02 +08:00
|
|
|
Prints the SQL statements that would be executed for the "flush" command.
|
2010-10-10 17:39:14 +08:00
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlindexes [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Prints the CREATE INDEX SQL statements for the given model module name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "sqlsequencereset [" "app_label ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Prints the SQL statements for resetting PostgreSQL sequences for the
|
|
|
|
given app name(s).
|
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "startapp [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "app_label" "] [" "destination" "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Creates a Django app directory structure for the given app name in
|
2011-12-23 06:38:02 +08:00
|
|
|
the current directory or the optional destination.
|
2007-06-10 14:33:31 +08:00
|
|
|
.TP
|
2012-02-04 21:01:30 +08:00
|
|
|
.BI "startproject [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "projectname" "] [" "destination" "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Creates a Django project directory structure for the given project name
|
2011-12-23 06:38:02 +08:00
|
|
|
in the current directory or the optional destination.
|
2007-06-10 14:33:31 +08:00
|
|
|
.TP
|
2013-07-25 23:19:36 +08:00
|
|
|
.BI migrate
|
|
|
|
Runs migrations for apps containing migrations, and just creates missing tables
|
|
|
|
for apps without migrations.
|
2007-06-10 14:33:31 +08:00
|
|
|
.TP
|
2013-12-28 16:53:02 +08:00
|
|
|
.BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "app_label ..." "]"
|
2010-10-10 17:39:14 +08:00
|
|
|
Runs the test suite for the specified applications, or the entire project if
|
|
|
|
no apps are specified
|
|
|
|
.TP
|
|
|
|
.BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
|
2007-06-10 14:33:31 +08:00
|
|
|
Runs the test suite for the specified applications, or the entire project if
|
|
|
|
no apps are specified
|
|
|
|
.TP
|
|
|
|
.BI validate
|
|
|
|
Validates all installed models.
|
|
|
|
.SH "OPTIONS"
|
|
|
|
.TP
|
|
|
|
.I \-\-version
|
|
|
|
Show program's version number and exit.
|
|
|
|
.TP
|
|
|
|
.I \-h, \-\-help
|
|
|
|
Show this help message and exit.
|
|
|
|
.TP
|
|
|
|
.I \-\-settings=SETTINGS
|
|
|
|
Python path to settings module, e.g. "myproject.settings.main". If
|
|
|
|
this isn't provided, the DJANGO_SETTINGS_MODULE environment variable
|
|
|
|
will be used.
|
|
|
|
.TP
|
|
|
|
.I \-\-pythonpath=PYTHONPATH
|
|
|
|
Lets you manually add a directory the Python path,
|
|
|
|
e.g. "/home/djangoprojects/myproject".
|
|
|
|
.TP
|
|
|
|
.I \-\-plain
|
|
|
|
Use plain Python, not IPython, for the "shell" command.
|
|
|
|
.TP
|
|
|
|
.I \-\-noinput
|
|
|
|
Do not prompt the user for input.
|
|
|
|
.TP
|
|
|
|
.I \-\-noreload
|
|
|
|
Disable the development server's auto\-reloader.
|
|
|
|
.TP
|
2010-11-14 02:41:55 +08:00
|
|
|
.I \-\-nostatic
|
2010-11-17 23:36:26 +08:00
|
|
|
Disable automatic serving of static files from STATIC_URL.
|
2010-11-14 02:41:55 +08:00
|
|
|
.TP
|
2011-06-17 21:08:36 +08:00
|
|
|
.I \-\-nothreading
|
|
|
|
Disable the development server's threading.
|
|
|
|
.TP
|
2010-11-14 02:41:55 +08:00
|
|
|
.I \-\-insecure
|
|
|
|
Enables serving of static files even if DEBUG is False.
|
|
|
|
.TP
|
2010-11-26 21:33:53 +08:00
|
|
|
.I \-\-ipv6
|
|
|
|
Enables IPv6 addresses.
|
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.I \-\-verbosity=VERBOSITY
|
|
|
|
Verbosity level: 0=minimal output, 1=normal output, 2=all output.
|
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.I \-\-traceback
|
|
|
|
By default, django-admin.py will show a simple error message whenever an
|
|
|
|
error occurs. If you specify this option, django-admin.py will
|
|
|
|
output a full stack trace whenever an exception is raised.
|
|
|
|
.TP
|
2008-07-06 14:39:44 +08:00
|
|
|
.I \-l, \-\-locale=LOCALE
|
|
|
|
The locale to process when using makemessages or compilemessages.
|
|
|
|
.TP
|
2014-05-01 15:03:24 +08:00
|
|
|
.I \-x, \-\-exclude=LOCALE
|
2014-03-24 21:03:06 +08:00
|
|
|
The locale to exclude from processing when using makemessages or compilemessages.
|
|
|
|
.TP
|
2008-07-06 14:39:44 +08:00
|
|
|
.I \-d, \-\-domain=DOMAIN
|
|
|
|
The domain of the message files (default: "django") when using makemessages.
|
|
|
|
.TP
|
2008-08-09 00:41:55 +08:00
|
|
|
.I \-e, \-\-extension=EXTENSION
|
2011-12-23 06:38:02 +08:00
|
|
|
The file extension(s) to examine (separate multiple
|
2012-03-26 03:04:11 +08:00
|
|
|
extensions with commas, or use \-e multiple times) (makemessages command).
|
2008-08-09 00:41:55 +08:00
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.I \-s, \-\-symlinks
|
2010-02-16 20:14:27 +08:00
|
|
|
Follows symlinks to directories when examining source code and templates for
|
2012-02-06 10:00:19 +08:00
|
|
|
translation strings (makemessages command).
|
2010-02-16 20:14:27 +08:00
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.I \-i, \-\-ignore=PATTERN
|
2010-02-16 20:15:04 +08:00
|
|
|
Ignore files or directories matching this glob-style pattern. Use multiple
|
2012-02-06 10:00:19 +08:00
|
|
|
times to ignore more (makemessages command).
|
2010-02-16 20:15:04 +08:00
|
|
|
.TP
|
2010-10-10 17:39:14 +08:00
|
|
|
.I \-\-no\-default\-ignore
|
2013-11-30 17:53:08 +08:00
|
|
|
Don't ignore the common private glob-style patterns 'CVS', '.*', '*~' and '*.pyc'
|
|
|
|
(makemessages command).
|
2010-02-16 20:15:04 +08:00
|
|
|
.TP
|
2010-11-04 20:08:37 +08:00
|
|
|
.I \-\-no\-wrap
|
2012-02-06 10:00:19 +08:00
|
|
|
Don't break long message lines into several lines (makemessages command).
|
|
|
|
.TP
|
|
|
|
.I \-\-no\-location
|
|
|
|
Don't write '#: filename:line' comment lines in language files (makemessages command).
|
2010-11-04 20:08:37 +08:00
|
|
|
.TP
|
2008-07-06 14:39:44 +08:00
|
|
|
.I \-a, \-\-all
|
2012-02-06 10:00:19 +08:00
|
|
|
Process all available locales when using makemessages.
|
2007-06-10 14:33:31 +08:00
|
|
|
.TP
|
2012-02-04 21:01:30 +08:00
|
|
|
.I \-\-template=PATH_OR_URL
|
2011-12-23 06:38:02 +08:00
|
|
|
The file or directory path or URL to load the project and app templates from.
|
|
|
|
.TP
|
2012-02-04 21:01:30 +08:00
|
|
|
.I \-n, \-\-name=FILENAME
|
|
|
|
The name of an additional file to render when using app and project templates.
|
|
|
|
.TP
|
2012-02-06 10:00:19 +08:00
|
|
|
.I \-\-database=DB
|
|
|
|
Used to specify the database on which a command will operate. If not
|
|
|
|
specified, this option will default to an alias of "default".
|
|
|
|
.SH "ENVIRONMENT"
|
|
|
|
.TP
|
2007-06-10 14:33:31 +08:00
|
|
|
.I DJANGO_SETTINGS_MODULE
|
|
|
|
In the absence of the
|
|
|
|
.BI \-\-settings
|
|
|
|
option, this environment variable defines the settings module to be read.
|
|
|
|
It should be in Python-import form, e.g. "myproject.settings".
|
|
|
|
|
|
|
|
.SH "SEE ALSO"
|
|
|
|
Full descriptions of all these options, with examples, as well as documentation
|
|
|
|
for the rest of the Django framework, can be found on the Django site:
|
|
|
|
.sp
|
2008-09-03 00:42:13 +08:00
|
|
|
.I http://docs.djangoproject.com/en/dev/
|
2007-06-10 14:33:31 +08:00
|
|
|
.sp
|
|
|
|
or in the distributed documentation.
|
|
|
|
.SH "AUTHORS/CREDITS"
|
|
|
|
Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
|
|
|
|
AUTHORS file in the Django distribution for contributors.
|
|
|
|
.sp
|
|
|
|
.SH "LICENSE"
|
|
|
|
New BSD license. For the full license text refer to the LICENSE file in the
|
|
|
|
Django distribution.
|
|
|
|
|