parts/django/docs/man/django-admin.1
changeset 69 c6bca38c1cbf
equal deleted inserted replaced
68:5ff1fc726848 69:c6bca38c1cbf
       
     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" "]"
       
    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" "] [" "\-\-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 \-\-verbosity=VERBOSITY
       
   168 Verbosity level: 0=minimal output, 1=normal output, 2=all output.
       
   169 .TP
       
   170 .I \-\-adminmedia=ADMIN_MEDIA_PATH
       
   171 Specifies the directory from which to serve admin media when using the development server.
       
   172 .TP
       
   173 .I \-\-traceback
       
   174 By default, django-admin.py will show a simple error message whenever an
       
   175 error occurs. If you specify this option, django-admin.py  will
       
   176 output a full stack trace whenever an exception is raised.
       
   177 .TP
       
   178 .I \-l, \-\-locale=LOCALE
       
   179 The locale to process when using makemessages or compilemessages.
       
   180 .TP
       
   181 .I \-d, \-\-domain=DOMAIN
       
   182 The domain of the message files (default: "django") when using makemessages.
       
   183 .TP
       
   184 .I \-e, \-\-extension=EXTENSION
       
   185 The file extension(s) to examine (default: ".html", separate multiple
       
   186 extensions with commas, or use -e multiple times).
       
   187 .TP
       
   188 .I \-s, \-\-symlinks
       
   189 Follows symlinks to directories when examining source code and templates for
       
   190 translation strings.
       
   191 .TP
       
   192 .I \-i, \-\-ignore=PATTERN
       
   193 Ignore files or directories matching this glob-style pattern. Use multiple
       
   194 times to ignore more.
       
   195 .TP
       
   196 .I \-\-no\-default\-ignore
       
   197 Don't ignore the common private glob-style patterns 'CVS', '.*' and '*~'.
       
   198 .TP
       
   199 .I \-a, \-\-all
       
   200 Process all available locales when using makemessages..SH "ENVIRONMENT"
       
   201 .TP
       
   202 .I DJANGO_SETTINGS_MODULE
       
   203 In the absence of the
       
   204 .BI \-\-settings
       
   205 option, this environment variable defines the settings module to be read.
       
   206 It should be in Python-import form, e.g. "myproject.settings".
       
   207 .I \-\-database=DB
       
   208 Used to specify the database on which a command will operate. If not
       
   209 specified, this option will default to an alias of "default".
       
   210 .TP
       
   211 
       
   212 .SH "SEE ALSO"
       
   213 Full descriptions of all these options, with examples, as well as documentation
       
   214 for the rest of the Django framework, can be found on the Django site:
       
   215 .sp
       
   216 .I http://docs.djangoproject.com/en/dev/
       
   217 .sp
       
   218 or in the distributed documentation.
       
   219 .SH "AUTHORS/CREDITS"
       
   220 Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
       
   221 AUTHORS file in the Django distribution for contributors.
       
   222 .sp
       
   223 .SH "LICENSE"
       
   224 New BSD license. For the full license text refer to the LICENSE file in the
       
   225 Django distribution.
       
   226