|
@@ -1,6 +1,6 @@
|
|
|
.\" 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
|
|
|
django-admin \- Utility script for the Django Web framework
|
|
|
.
|
|
@@ -135,8 +135,6 @@ django\-admin check auth admin myapp
|
|
|
.fi
|
|
|
.UNINDENT
|
|
|
.UNINDENT
|
|
|
-.sp
|
|
|
-If you do not specify any app, all apps will be checked.
|
|
|
.INDENT 0.0
|
|
|
.TP
|
|
|
.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
|
|
|
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
|
|
|
-module, either by setting the \fBDJANGO_SETTINGS_MODULE\fP environment variable,
|
|
|
-or by passing the \fB\-\-settings\fP option:
|
|
|
+module, either by setting the \fBDJANGO_SETTINGS_MODULE\fP environment
|
|
|
+variable, or by passing the \fB\-\-settings\fP option:
|
|
|
.INDENT 0.0
|
|
|
.INDENT 3.5
|
|
|
.sp
|
|
@@ -241,7 +239,7 @@ are excluded.
|
|
|
.B \-\-use\-fuzzy, \-f
|
|
|
.UNINDENT
|
|
|
.sp
|
|
|
-Includes fuzzy translations into compiled files.
|
|
|
+Includes \fI\%fuzzy translations\fP into compiled files.
|
|
|
.sp
|
|
|
Example usage:
|
|
|
.INDENT 0.0
|
|
@@ -265,8 +263,6 @@ django\-admin compilemessages \-x pt_BR \-x fr
|
|
|
.TP
|
|
|
.B \-\-ignore PATTERN, \-i PATTERN
|
|
|
.UNINDENT
|
|
|
-.sp
|
|
|
-
|
|
|
.sp
|
|
|
Ignores directories matching the given \fI\%glob\fP\-style pattern. Use
|
|
|
multiple times to ignore more.
|
|
@@ -524,6 +520,23 @@ standard output.
|
|
|
.sp
|
|
|
When this option is set and \fB\-\-verbosity\fP is greater than 0 (the default), a
|
|
|
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
|
|
|
.INDENT 0.0
|
|
|
.TP
|
|
@@ -821,7 +834,8 @@ end of the transaction.
|
|
|
The \fI\%dumpdata\fP command can be used to generate input for \fBloaddata\fP\&.
|
|
|
.SS Compressed fixtures
|
|
|
.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 3.5
|
|
|
.sp
|
|
@@ -833,9 +847,9 @@ django\-admin loaddata mydata.json
|
|
|
.UNINDENT
|
|
|
.UNINDENT
|
|
|
.sp
|
|
|
-would look for any of \fBmydata.json\fP, \fBmydata.json.zip\fP,
|
|
|
-\fBmydata.json.gz\fP, or \fBmydata.json.bz2\fP\&. The first file contained within a
|
|
|
-zip\-compressed archive is used.
|
|
|
+would look for any of \fBmydata.json\fP, \fBmydata.json.zip\fP, \fBmydata.json.gz\fP,
|
|
|
+\fBmydata.json.bz2\fP, \fBmydata.json.lzma\fP, or \fBmydata.json.xz\fP\&. The first
|
|
|
+file contained within a compressed archive is used.
|
|
|
.sp
|
|
|
Note that if two fixtures with the same name but different
|
|
|
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.
|
|
|
.UNINDENT
|
|
|
.UNINDENT
|
|
|
+.sp
|
|
|
+Support for XZ archives (\fB\&.xz\fP) and LZMA archives (\fB\&.lzma\fP) was added.
|
|
|
+
|
|
|
.SS Database\-specific fixtures
|
|
|
.sp
|
|
|
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
|
|
|
Makes \fBmakemigrations\fP exit with a non\-zero status when model changes without
|
|
|
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
|
|
|
.INDENT 0.0
|
|
|
.TP
|
|
@@ -1295,9 +1317,13 @@ on how to do this.
|
|
|
.INDENT 0.0
|
|
|
.INDENT 3.5
|
|
|
.IP "Watchman timeout"
|
|
|
+.INDENT 0.0
|
|
|
+.TP
|
|
|
+.B DJANGO_WATCHMAN_TIMEOUT
|
|
|
+.UNINDENT
|
|
|
.sp
|
|
|
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
|
|
|
.sp
|
|
@@ -1611,9 +1637,6 @@ Apps without migrations are also listed, but have \fB(no migrations)\fP printed
|
|
|
under them.
|
|
|
.sp
|
|
|
This is the default output format.
|
|
|
-.sp
|
|
|
-Output of the applied datetimes at verbosity 2 and above was added.
|
|
|
-
|
|
|
.INDENT 0.0
|
|
|
.TP
|
|
|
.B \-\-plan, \-p
|
|
@@ -1799,10 +1822,6 @@ django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-t
|
|
|
.fi
|
|
|
.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
|
|
|
.TP
|
|
|
.B \-\-extension EXTENSIONS, \-e EXTENSIONS
|
|
@@ -2000,6 +2019,10 @@ Enables SQL logging for failing tests. If
|
|
|
.TP
|
|
|
.B \-\-parallel [N]
|
|
|
.UNINDENT
|
|
|
+.INDENT 0.0
|
|
|
+.TP
|
|
|
+.B DJANGO_TEST_PROCESSES
|
|
|
+.UNINDENT
|
|
|
.sp
|
|
|
Runs tests in separate parallel processes. Since modern processors have
|
|
|
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
|
|
|
\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
|
|
|
-setting the \fBDJANGO_TEST_PROCESSES\fP environment variable.
|
|
|
+setting the \fI\%DJANGO_TEST_PROCESSES\fP environment variable.
|
|
|
.sp
|
|
|
Django distributes test cases — \fI\%unittest.TestCase\fP subclasses — to
|
|
|
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
|
|
|
.B \-k TEST_NAME_PATTERNS
|
|
|
.UNINDENT
|
|
|
-.sp
|
|
|
-
|
|
|
.sp
|
|
|
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.
|
|
@@ -2093,8 +2114,6 @@ This feature is only available for Python 3.7 and later.
|
|
|
.TP
|
|
|
.B \-\-pdb
|
|
|
.UNINDENT
|
|
|
-.sp
|
|
|
-
|
|
|
.sp
|
|
|
Spawns a \fBpdb\fP debugger at each test error or failure. If you have it
|
|
|
installed, \fBipdb\fP is used instead.
|
|
@@ -2107,6 +2126,24 @@ installed, \fBipdb\fP is used instead.
|
|
|
.sp
|
|
|
Discards output (\fBstdout\fP and \fBstderr\fP) for passing tests, in the same way
|
|
|
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
|
|
|
.INDENT 0.0
|
|
|
.TP
|
|
@@ -2247,6 +2284,10 @@ django\-admin changepassword ringo
|
|
|
.TP
|
|
|
.B django\-admin createsuperuser
|
|
|
.UNINDENT
|
|
|
+.INDENT 0.0
|
|
|
+.TP
|
|
|
+.B DJANGO_SUPERUSER_PASSWORD
|
|
|
+.UNINDENT
|
|
|
.sp
|
|
|
This command is only available if Django\(aqs authentication system (\fBdjango.contrib.auth\fP) is installed.
|
|
|
.sp
|
|
@@ -2256,9 +2297,9 @@ programmatically generate superuser accounts for your site(s).
|
|
|
.sp
|
|
|
When run interactively, this command will prompt for a password for
|
|
|
the new superuser account. When run non\-interactively, you can provide
|
|
|
-a password by setting the \fBDJANGO_SUPERUSER_PASSWORD\fP environment variable.
|
|
|
-Otherwise, no password will be set, and the superuser account will not be able
|
|
|
-to log in until a password has been manually set for it.
|
|
|
+a password by setting the \fI\%DJANGO_SUPERUSER_PASSWORD\fP environment
|
|
|
+variable. Otherwise, no password will be set, and the superuser account will
|
|
|
+not be able to log in until a password has been manually set for it.
|
|
|
.sp
|
|
|
In non\-interactive mode, the
|
|
|
\fBUSERNAME_FIELD\fP and required
|
|
@@ -2267,10 +2308,6 @@ fields (listed in
|
|
|
\fBDJANGO_SUPERUSER_<uppercase_field_name>\fP environment variables, unless they
|
|
|
are overridden by a command line argument. For example, to provide an \fBemail\fP
|
|
|
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
|
|
|
.TP
|
|
|
.B \-\-noinput, \-\-no\-input
|
|
@@ -2378,7 +2415,7 @@ allows for the following options:
|
|
|
.UNINDENT
|
|
|
.sp
|
|
|
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.
|
|
|
.sp
|
|
|
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
|
|
|
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,
|
|
|
-\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
|
|
|
This option is unnecessary in \fBmanage.py\fP, because it uses
|
|
|
\fBsettings.py\fP from the current project by default.
|
|
@@ -2499,13 +2537,11 @@ colored output to another command.
|
|
|
.TP
|
|
|
.B \-\-skip\-checks
|
|
|
.UNINDENT
|
|
|
-.sp
|
|
|
-
|
|
|
.sp
|
|
|
Skips running system checks prior to running the command. This option is only
|
|
|
available if the
|
|
|
\fBrequires_system_checks\fP command
|
|
|
-attribute is set to \fBTrue\fP\&.
|
|
|
+attribute is not an empty list or tuple.
|
|
|
.sp
|
|
|
Example usage:
|
|
|
.INDENT 0.0
|
|
@@ -2520,16 +2556,54 @@ django\-admin migrate \-\-skip\-checks
|
|
|
.UNINDENT
|
|
|
.SH EXTRA NICETIES
|
|
|
.SS Syntax coloring
|
|
|
+.INDENT 0.0
|
|
|
+.TP
|
|
|
+.B DJANGO_COLORS
|
|
|
+.UNINDENT
|
|
|
.sp
|
|
|
The \fBdjango\-admin\fP / \fBmanage.py\fP commands will use pretty
|
|
|
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
|
|
|
another program unless the \fI\%\-\-force\-color\fP option is used.
|
|
|
+.SS Windows support
|
|
|
+.sp
|
|
|
+On Windows 10, the \fI\%Windows Terminal\fP application, \fI\%VS Code\fP, and PowerShell
|
|
|
+(where virtual terminal processing is enabled) allow colored output, and are
|
|
|
+supported by default.
|
|
|
+.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
|
|
|
-Under Windows, the native console doesn\(aqt support ANSI escape sequences so by
|
|
|
-default there is no color output. But you can install the \fI\%ANSICON\fP
|
|
|
-third\-party tool, the Django commands will detect its presence and will make
|
|
|
-use of its services to color output just like on Unix\-based platforms.
|
|
|
+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
|
|
|
The colors used for syntax highlighting can be customized. Django
|
|
|
ships with three color palettes:
|
|
@@ -2544,7 +2618,7 @@ background.
|
|
|
\fBnocolor\fP, which disables syntax highlighting.
|
|
|
.UNINDENT
|
|
|
.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
|
|
|
specify the \fBlight\fP palette under a Unix or OS/X BASH shell, you
|
|
|
would run the following at a command prompt:
|