Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

213 lines (211 sloc) 7.6 kb
.TH "django-admin" "1" "March 2008" "Django Project" ""
django\-admin \- Utility script for the Django Web framework
.B django\-admin
.I <action>
.B [options]
This utility script provides commands for creation and maintenance of Django
projects and apps.
With the exception of
.BI startproject,
all commands listed below can also be performed with the
script found at the top level of each Django project directory.
.BI cleanup
Cleans out old data from the database (only expired sessions at the moment).
.BI "compilemessages [" "\-\-locale=LOCALE" "] [" "\-\-exclude=LOCALE" "] [" "\-\-use\-fuzzy" "]"
Compiles .po files to .mo files for use with builtin gettext support.
.BI "createcachetable [" "tablename" "]"
Creates the table needed to use the SQL cache backend
.BI "createsuperuser [" "\-\-username=USERNAME" "] [" "\-\-email=EMAIL" "]"
Creates a superuser account (a user who has all permissions).
.B dbshell
Runs the command\-line client for the specified
.BI database ENGINE.
.B diffsettings
Displays differences between the current
and Django's default settings. Settings that don't appear in the defaults are
followed by "###".
.BI "dumpdata [" "\-\-all" "] [" "\-\-format=FMT" "] [" "\-\-indent=NUM" "] [" "\-\-natural=NATURAL" "] [" "app_label app_label app_label.Model ..." "]"
Outputs to standard output all data in the database associated with the named
.BI flush
Removes all data from the database and then re-installs any initial data.
.B inspectdb
Introspects the database tables in the database specified in and outputs a Django
model module.
.BI "loaddata [" "fixture fixture ..." "]"
Searches for and loads the contents of the named fixture into the database.
.BI "install [" "app_label ..." "]"
.B sqlall
for the given app(s) in the current database.
.BI "makemessages [" "\-\-locale=LOCALE" "] [" "\-\-exclude=LOCALE" "] [" "\-\-domain=DOMAIN" "] [" "\-\-extension=EXTENSION" "] [" "\-\-all" "] [" "\-\-symlinks" "] [" "\-\-ignore=PATTERN" "] [" "\-\-no\-default\-ignore" "] [" "\-\-no\-wrap" "] [" "\-\-no\-location" "]"
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.
.BI "runserver [" "\-\-noreload" "] [" "\-\-nothreading" "] [" "\-\-nostatic" "] [" "\-\-insecure" "] [" "\-\-ipv6" "] [" "port|ipaddr:port" "]"
Starts a lightweight Web server for development.
.BI "shell [" "\-\-plain" "]"
Runs a Python interactive interpreter. Tries to use IPython, if it's available.
.BI \-\-plain
option forces the use of the standard Python interpreter even when IPython is
.BI "sqlflush [" "app_label ..." "]"
Prints the SQL statements that would be executed for the "flush" command.
.BI "sqlsequencereset [" "app_label ..." "]"
Prints the SQL statements for resetting PostgreSQL sequences for the
given app name(s).
.BI "startapp [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "app_label" "] [" "destination" "]"
Creates a Django app directory structure for the given app name in
the current directory or the optional destination.
.BI "startproject [" "\-\-template=PATH_OR_URL" "] [" "\-\-extension=EXTENSION" "] [" "\-\-name=FILENAME" "] [" "projectname" "] [" "destination" "]"
Creates a Django project directory structure for the given project name
in the current directory or the optional destination.
.BI migrate
Runs migrations for all apps.
.BI "test [" "\-\-verbosity" "] [" "\-\-failfast" "] [" "app_label ..." "]"
Runs the test suite for the specified applications, or the entire project if
no apps are specified
.BI "testserver [" "\-\-addrport=ipaddr|port" "] [" "fixture fixture ..." "]"
Runs the test suite for the specified applications, or the entire project if
no apps are specified
.I \-\-version
Show program's version number and exit.
.I \-h, \-\-help
Show this help message and exit.
.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.
.I \-\-pythonpath=PYTHONPATH
Lets you manually add a directory the Python path,
e.g. "/home/djangoprojects/myproject".
.I \-\-plain
Use plain Python, not IPython, for the "shell" command.
.I \-\-noinput
Do not prompt the user for input.
.I \-\-noreload
Disable the development server's auto\-reloader.
.I \-\-nostatic
Disable automatic serving of static files from STATIC_URL.
.I \-\-nothreading
Disable the development server's threading.
.I \-\-insecure
Enables serving of static files even if DEBUG is False.
.I \-\-ipv6
Enables IPv6 addresses.
.I \-\-verbosity=VERBOSITY
Verbosity level: 0=minimal output, 1=normal output, 2=all output.
.I \-\-traceback
By default, django-admin will show a simple error message whenever an
error occurs. If you specify this option, django-admin will
output a full stack trace whenever an exception is raised.
.I \-l, \-\-locale=LOCALE
The locale to process when using makemessages or compilemessages.
.I \-x, \-\-exclude=LOCALE
The locale to exclude from processing when using makemessages or compilemessages.
.I \-d, \-\-domain=DOMAIN
The domain of the message files (default: "django") when using makemessages.
.I \-e, \-\-extension=EXTENSION
The file extension(s) to examine (separate multiple
extensions with commas, or use \-e multiple times) (makemessages command).
.I \-s, \-\-symlinks
Follows symlinks to directories when examining source code and templates for
translation strings (makemessages command).
.I \-i, \-\-ignore=PATTERN
Ignore files or directories matching this glob-style pattern. Use multiple
times to ignore more (makemessages command).
.I \-\-no\-default\-ignore
Don't ignore the common private glob-style patterns 'CVS', '.*', '*~' and '*.pyc'
(makemessages command).
.I \-\-no\-wrap
Don't break long message lines into several lines (makemessages command).
.I \-\-no\-location
Don't write '#: filename:line' comment lines in language files (makemessages command).
.I \-a, \-\-all
Process all available locales when using makemessages.
.I \-\-template=PATH_OR_URL
The file or directory path or URL to load the project and app templates from.
.I \-n, \-\-name=FILENAME
The name of an additional file to render when using app and project templates.
.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".
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".
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:
or in the distributed documentation.
Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
AUTHORS file in the Django distribution for contributors.
New BSD license. For the full license text refer to the LICENSE file in the
Django distribution.
Jump to Line
Something went wrong with that request. Please try again.