Updated django-admin man page for Django 3.2.

This commit is contained in:
Carlton Gibson 2021-01-14 11:24:18 +01:00 committed by Carlton Gibson
parent 257dfce6c8
commit db971f63ab
1 changed files with 116 additions and 42 deletions

View File

@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText. .\" Man page generated from reStructuredText.
. .
.TH "DJANGO-ADMIN" "1" "May 12, 2020" "3.1" "Django" .TH "DJANGO-ADMIN" "1" "January 14, 2021" "3.2" "Django"
.SH NAME .SH NAME
django-admin \- Utility script for the Django Web framework django-admin \- Utility script for the Django Web framework
. .
@ -135,8 +135,6 @@ django\-admin check auth admin myapp
.fi .fi
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
If you do not specify any app, all apps will be checked.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-tag TAGS, \-t TAGS .B \-\-tag TAGS, \-t TAGS
@ -192,8 +190,8 @@ Activates some additional checks that are only relevant in a deployment setting.
You can use this option in your local development environment, but since your You can use this option in your local development environment, but since your
local development settings module may not have many of your production settings, local development settings module may not have many of your production settings,
you will probably want to point the \fBcheck\fP command at a different settings you will probably want to point the \fBcheck\fP command at a different settings
module, either by setting the \fBDJANGO_SETTINGS_MODULE\fP environment variable, module, either by setting the \fBDJANGO_SETTINGS_MODULE\fP environment
or by passing the \fB\-\-settings\fP option: variable, or by passing the \fB\-\-settings\fP option:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
@ -241,7 +239,7 @@ are excluded.
.B \-\-use\-fuzzy, \-f .B \-\-use\-fuzzy, \-f
.UNINDENT .UNINDENT
.sp .sp
Includes fuzzy translations into compiled files. Includes \fI\%fuzzy translations\fP into compiled files.
.sp .sp
Example usage: Example usage:
.INDENT 0.0 .INDENT 0.0
@ -265,8 +263,6 @@ django\-admin compilemessages \-x pt_BR \-x fr
.TP .TP
.B \-\-ignore PATTERN, \-i PATTERN .B \-\-ignore PATTERN, \-i PATTERN
.UNINDENT .UNINDENT
.sp
.sp .sp
Ignores directories matching the given \fI\%glob\fP\-style pattern. Use Ignores directories matching the given \fI\%glob\fP\-style pattern. Use
multiple times to ignore more. multiple times to ignore more.
@ -524,6 +520,23 @@ standard output.
.sp .sp
When this option is set and \fB\-\-verbosity\fP is greater than 0 (the default), a When this option is set and \fB\-\-verbosity\fP is greater than 0 (the default), a
progress bar is shown in the terminal. progress bar is shown in the terminal.
.SS Fixtures compression
.sp
.sp
The output file can be compressed with one of the \fBbz2\fP, \fBgz\fP, \fBlzma\fP, or
\fBxz\fP formats by ending the filename with the corresponding extension.
For example, to output the data as a compressed JSON file:
.INDENT 0.0
.INDENT 3.5
.sp
.nf
.ft C
django\-admin dumpdata \-o mydata.json.gz
.ft P
.fi
.UNINDENT
.UNINDENT
.SS \fBflush\fP .SS \fBflush\fP
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -821,7 +834,8 @@ end of the transaction.
The \fI\%dumpdata\fP command can be used to generate input for \fBloaddata\fP\&. The \fI\%dumpdata\fP command can be used to generate input for \fBloaddata\fP\&.
.SS Compressed fixtures .SS Compressed fixtures
.sp .sp
Fixtures may be compressed in \fBzip\fP, \fBgz\fP, or \fBbz2\fP format. For example: Fixtures may be compressed in \fBzip\fP, \fBgz\fP, \fBbz2\fP, \fBlzma\fP, or \fBxz\fP
format. For example:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
@ -833,9 +847,9 @@ django\-admin loaddata mydata.json
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
would look for any of \fBmydata.json\fP, \fBmydata.json.zip\fP, would look for any of \fBmydata.json\fP, \fBmydata.json.zip\fP, \fBmydata.json.gz\fP,
\fBmydata.json.gz\fP, or \fBmydata.json.bz2\fP\&. The first file contained within a \fBmydata.json.bz2\fP, \fBmydata.json.lzma\fP, or \fBmydata.json.xz\fP\&. The first
zip\-compressed archive is used. file contained within a compressed archive is used.
.sp .sp
Note that if two fixtures with the same name but different Note that if two fixtures with the same name but different
fixture type are discovered (for example, if \fBmydata.json\fP and fixture type are discovered (for example, if \fBmydata.json\fP and
@ -851,6 +865,9 @@ constraints, so if you use MyISAM, you won\(aqt get validation of fixture
data, or a rollback if multiple transaction files are found. data, or a rollback if multiple transaction files are found.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
Support for XZ archives (\fB\&.xz\fP) and LZMA archives (\fB\&.lzma\fP) was added.
.SS Database\-specific fixtures .SS Database\-specific fixtures
.sp .sp
If you\(aqre in a multi\-database setup, you might have fixture data that If you\(aqre in a multi\-database setup, you might have fixture data that
@ -1149,6 +1166,11 @@ Generate migration files without Django version and timestamp header.
.sp .sp
Makes \fBmakemigrations\fP exit with a non\-zero status when model changes without Makes \fBmakemigrations\fP exit with a non\-zero status when model changes without
migrations are detected. migrations are detected.
.sp
Support for calling \fBmakemigrations\fP without an active database
connection was added. In that case, check for a consistent migration
history is skipped.
.SS \fBmigrate\fP .SS \fBmigrate\fP
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -1295,9 +1317,13 @@ on how to do this.
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.IP "Watchman timeout" .IP "Watchman timeout"
.INDENT 0.0
.TP
.B DJANGO_WATCHMAN_TIMEOUT
.UNINDENT
.sp .sp
The default timeout of \fBWatchman\fP client is 5 seconds. You can change it The default timeout of \fBWatchman\fP client is 5 seconds. You can change it
by setting the \fBDJANGO_WATCHMAN_TIMEOUT\fP environment variable. by setting the \fI\%DJANGO_WATCHMAN_TIMEOUT\fP environment variable.
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp .sp
@ -1611,9 +1637,6 @@ Apps without migrations are also listed, but have \fB(no migrations)\fP printed
under them. under them.
.sp .sp
This is the default output format. This is the default output format.
.sp
Output of the applied datetimes at verbosity 2 and above was added.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-plan, \-p .B \-\-plan, \-p
@ -1799,10 +1822,6 @@ django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-t
.fi .fi
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
Support for XZ archives (\fB\&.tar.xz\fP, \fB\&.txz\fP) and LZMA archives
(\fB\&.tar.lzma\fP, \fB\&.tlz\fP) was added.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-extension EXTENSIONS, \-e EXTENSIONS .B \-\-extension EXTENSIONS, \-e EXTENSIONS
@ -2000,6 +2019,10 @@ Enables SQL logging for failing tests. If
.TP .TP
.B \-\-parallel [N] .B \-\-parallel [N]
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B DJANGO_TEST_PROCESSES
.UNINDENT
.sp .sp
Runs tests in separate parallel processes. Since modern processors have Runs tests in separate parallel processes. Since modern processors have
multiple cores, this allows running tests significantly faster. multiple cores, this allows running tests significantly faster.
@ -2007,7 +2030,7 @@ multiple cores, this allows running tests significantly faster.
By default \fB\-\-parallel\fP runs one process per core according to By default \fB\-\-parallel\fP runs one process per core according to
\fI\%multiprocessing.cpu_count()\fP\&. You can adjust the number of processes \fI\%multiprocessing.cpu_count()\fP\&. You can adjust the number of processes
either by providing it as the option\(aqs value, e.g. \fB\-\-parallel=4\fP, or by either by providing it as the option\(aqs value, e.g. \fB\-\-parallel=4\fP, or by
setting the \fBDJANGO_TEST_PROCESSES\fP environment variable. setting the \fI\%DJANGO_TEST_PROCESSES\fP environment variable.
.sp .sp
Django distributes test cases — \fI\%unittest.TestCase\fP subclasses — to Django distributes test cases — \fI\%unittest.TestCase\fP subclasses — to
subprocesses. If there are fewer test cases than configured processes, Django subprocesses. If there are fewer test cases than configured processes, Django
@ -2077,8 +2100,6 @@ May be specified multiple times and combined with \fI\%test \-\-tag\fP\&.
.TP .TP
.B \-k TEST_NAME_PATTERNS .B \-k TEST_NAME_PATTERNS
.UNINDENT .UNINDENT
.sp
.sp .sp
Runs test methods and classes matching test name patterns, in the same way as Runs test methods and classes matching test name patterns, in the same way as
\fI\%unittest\(aqs \-k option\fP\&. Can be specified multiple times. \fI\%unittest\(aqs \-k option\fP\&. Can be specified multiple times.
@ -2093,8 +2114,6 @@ This feature is only available for Python 3.7 and later.
.TP .TP
.B \-\-pdb .B \-\-pdb
.UNINDENT .UNINDENT
.sp
.sp .sp
Spawns a \fBpdb\fP debugger at each test error or failure. If you have it Spawns a \fBpdb\fP debugger at each test error or failure. If you have it
installed, \fBipdb\fP is used instead. installed, \fBipdb\fP is used instead.
@ -2107,6 +2126,24 @@ installed, \fBipdb\fP is used instead.
.sp .sp
Discards output (\fBstdout\fP and \fBstderr\fP) for passing tests, in the same way Discards output (\fBstdout\fP and \fBstderr\fP) for passing tests, in the same way
as \fI\%unittest\(aqs \-\-buffer option\fP\&. as \fI\%unittest\(aqs \-\-buffer option\fP\&.
.INDENT 0.0
.TP
.B \-\-no\-faulthandler
.UNINDENT
.sp
.sp
Django automatically calls \fI\%faulthandler.enable()\fP when starting the
tests, which allows it to print a traceback if the interpreter crashes. Pass
\fB\-\-no\-faulthandler\fP to disable this behavior.
.INDENT 0.0
.TP
.B \-\-timing
.UNINDENT
.sp
.sp
Outputs timings, including database setup and total run time.
.SS \fBtestserver\fP .SS \fBtestserver\fP
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -2247,6 +2284,10 @@ django\-admin changepassword ringo
.TP .TP
.B django\-admin createsuperuser .B django\-admin createsuperuser
.UNINDENT .UNINDENT
.INDENT 0.0
.TP
.B DJANGO_SUPERUSER_PASSWORD
.UNINDENT
.sp .sp
This command is only available if Django\(aqs authentication system (\fBdjango.contrib.auth\fP) is installed. This command is only available if Django\(aqs authentication system (\fBdjango.contrib.auth\fP) is installed.
.sp .sp
@ -2256,9 +2297,9 @@ programmatically generate superuser accounts for your site(s).
.sp .sp
When run interactively, this command will prompt for a password for When run interactively, this command will prompt for a password for
the new superuser account. When run non\-interactively, you can provide the new superuser account. When run non\-interactively, you can provide
a password by setting the \fBDJANGO_SUPERUSER_PASSWORD\fP environment variable. a password by setting the \fI\%DJANGO_SUPERUSER_PASSWORD\fP environment
Otherwise, no password will be set, and the superuser account will not be able variable. Otherwise, no password will be set, and the superuser account will
to log in until a password has been manually set for it. not be able to log in until a password has been manually set for it.
.sp .sp
In non\-interactive mode, the In non\-interactive mode, the
\fBUSERNAME_FIELD\fP and required \fBUSERNAME_FIELD\fP and required
@ -2267,10 +2308,6 @@ fields (listed in
\fBDJANGO_SUPERUSER_<uppercase_field_name>\fP environment variables, unless they \fBDJANGO_SUPERUSER_<uppercase_field_name>\fP environment variables, unless they
are overridden by a command line argument. For example, to provide an \fBemail\fP are overridden by a command line argument. For example, to provide an \fBemail\fP
field, you can use \fBDJANGO_SUPERUSER_EMAIL\fP environment variable. field, you can use \fBDJANGO_SUPERUSER_EMAIL\fP environment variable.
.sp
Support for using \fBDJANGO_SUPERUSER_PASSWORD\fP and
\fBDJANGO_SUPERUSER_<uppercase_field_name>\fP environment variables was added.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-noinput, \-\-no\-input .B \-\-noinput, \-\-no\-input
@ -2378,7 +2415,7 @@ allows for the following options:
.UNINDENT .UNINDENT
.sp .sp
Adds the given filesystem path to the Python \fI\%import search path\fP\&. If this Adds the given filesystem path to the Python \fI\%import search path\fP\&. If this
isn\(aqt provided, \fBdjango\-admin\fP will use the \fBPYTHONPATH\fP environment isn\(aqt provided, \fBdjango\-admin\fP will use the \fI\%PYTHONPATH\fP environment
variable. variable.
.sp .sp
This option is unnecessary in \fBmanage.py\fP, because it takes care of setting This option is unnecessary in \fBmanage.py\fP, because it takes care of setting
@ -2402,7 +2439,8 @@ django\-admin migrate \-\-pythonpath=\(aq/home/djangoprojects/myproject\(aq
.sp .sp
Specifies the settings module to use. The settings module should be in Python Specifies the settings module to use. The settings module should be in Python
package syntax, e.g. \fBmysite.settings\fP\&. If this isn\(aqt provided, package syntax, e.g. \fBmysite.settings\fP\&. If this isn\(aqt provided,
\fBdjango\-admin\fP will use the \fBDJANGO_SETTINGS_MODULE\fP environment variable. \fBdjango\-admin\fP will use the \fBDJANGO_SETTINGS_MODULE\fP environment
variable.
.sp .sp
This option is unnecessary in \fBmanage.py\fP, because it uses This option is unnecessary in \fBmanage.py\fP, because it uses
\fBsettings.py\fP from the current project by default. \fBsettings.py\fP from the current project by default.
@ -2499,13 +2537,11 @@ colored output to another command.
.TP .TP
.B \-\-skip\-checks .B \-\-skip\-checks
.UNINDENT .UNINDENT
.sp
.sp .sp
Skips running system checks prior to running the command. This option is only Skips running system checks prior to running the command. This option is only
available if the available if the
\fBrequires_system_checks\fP command \fBrequires_system_checks\fP command
attribute is set to \fBTrue\fP\&. attribute is not an empty list or tuple.
.sp .sp
Example usage: Example usage:
.INDENT 0.0 .INDENT 0.0
@ -2520,16 +2556,54 @@ django\-admin migrate \-\-skip\-checks
.UNINDENT .UNINDENT
.SH EXTRA NICETIES .SH EXTRA NICETIES
.SS Syntax coloring .SS Syntax coloring
.INDENT 0.0
.TP
.B DJANGO_COLORS
.UNINDENT
.sp .sp
The \fBdjango\-admin\fP / \fBmanage.py\fP commands will use pretty The \fBdjango\-admin\fP / \fBmanage.py\fP commands will use pretty
color\-coded output if your terminal supports ANSI\-colored output. It color\-coded output if your terminal supports ANSI\-colored output. It
won\(aqt use the color codes if you\(aqre piping the command\(aqs output to won\(aqt use the color codes if you\(aqre piping the command\(aqs output to
another program unless the \fI\%\-\-force\-color\fP option is used. another program unless the \fI\%\-\-force\-color\fP option is used.
.SS Windows support
.sp .sp
Under Windows, the native console doesn\(aqt support ANSI escape sequences so by On Windows 10, the \fI\%Windows Terminal\fP application, \fI\%VS Code\fP, and PowerShell
default there is no color output. But you can install the \fI\%ANSICON\fP (where virtual terminal processing is enabled) allow colored output, and are
third\-party tool, the Django commands will detect its presence and will make supported by default.
use of its services to color output just like on Unix\-based platforms. .sp
Under Windows, the legacy \fBcmd.exe\fP native console doesn\(aqt support ANSI
escape sequences so by default there is no color output. In this case either of
two third\-party libraries are needed:
.INDENT 0.0
.IP \(bu 2
Install \fI\%colorama\fP, a Python package that translates ANSI color codes into
Windows API calls. Django commands will detect its presence and will make use
of its services to color output just like on Unix\-based platforms.
\fBcolorama\fP can be installed via pip:
.INDENT 2.0
.INDENT 3.5
.sp
.nf
.ft C
\&...\e> py \-m pip install colorama
.ft P
.fi
.UNINDENT
.UNINDENT
.IP \(bu 2
Install \fI\%ANSICON\fP, a third\-party tool that allows \fBcmd.exe\fP to process
ANSI color codes. Django commands will detect its presence and will make use
of its services to color output just like on Unix\-based platforms.
.UNINDENT
.sp
Other modern terminal environments on Windows, that support terminal colors,
but which are not automatically detected as supported by Django, may "fake" the
installation of \fBANSICON\fP by setting the appropriate environmental variable,
\fBANSICON="on"\fP\&.
.sp
Updated support for syntax coloring on Windows.
.SS Custom colors
.sp .sp
The colors used for syntax highlighting can be customized. Django The colors used for syntax highlighting can be customized. Django
ships with three color palettes: ships with three color palettes:
@ -2544,7 +2618,7 @@ background.
\fBnocolor\fP, which disables syntax highlighting. \fBnocolor\fP, which disables syntax highlighting.
.UNINDENT .UNINDENT
.sp .sp
You select a palette by setting a \fBDJANGO_COLORS\fP environment You select a palette by setting a \fI\%DJANGO_COLORS\fP environment
variable to specify the palette you want to use. For example, to variable to specify the palette you want to use. For example, to
specify the \fBlight\fP palette under a Unix or OS/X BASH shell, you specify the \fBlight\fP palette under a Unix or OS/X BASH shell, you
would run the following at a command prompt: would run the following at a command prompt: