summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlton Gibson <carlton.gibson@noumenal.es>2022-05-17 10:09:39 +0200
committerCarlton Gibson <carlton.gibson@noumenal.es>2022-05-17 11:21:08 +0200
commit5325a6344ce3d3f64dadfc85256a5d1678f23faa (patch)
tree1789f430f2fc38f78a3b27c5ba81da95eb18063f
parentd6e3756946b019083f73ccb2bbf7ddf0b008d157 (diff)
Updated man page for Django 4.1 alpha.
-rw-r--r--docs/man/django-admin.198
1 files changed, 76 insertions, 22 deletions
diff --git a/docs/man/django-admin.1 b/docs/man/django-admin.1
index 616eb780ae..c608d8dcf8 100644
--- a/docs/man/django-admin.1
+++ b/docs/man/django-admin.1
@@ -1,6 +1,6 @@
.\" Man page generated from reStructuredText.
.
-.TH "DJANGO-ADMIN" "1" "September 20, 2021" "4.0" "Django"
+.TH "DJANGO-ADMIN" "1" "May 17, 2022" "4.1" "Django"
.SH NAME
django-admin \- Utility script for the Django web framework
.
@@ -518,8 +518,6 @@ When this option is set and \fB\-\-verbosity\fP is greater than 0 (the default),
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:
@@ -542,7 +540,7 @@ django\-admin dumpdata \-o mydata.json.gz
Removes all data from the database and re\-executes any post\-synchronization
handlers. The table of which migrations have been applied is not cleared.
.sp
-If you would rather start from an empty database and re\-run all migrations, you
+If you would rather start from an empty database and rerun all migrations, you
should drop and recreate the database and then run \fI\%migrate\fP instead.
.INDENT 0.0
.TP
@@ -861,19 +859,16 @@ 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
you want to load onto one database, but not onto another. In this
situation, you can add a database identifier into the names of your fixtures.
.sp
-For example, if your \fBDATABASES\fP setting has a \(aqmaster\(aq database
-defined, name the fixture \fBmydata.master.json\fP or
-\fBmydata.master.json.gz\fP and the fixture will only be loaded when you
-specify you want to load data into the \fBmaster\fP database.
+For example, if your \fBDATABASES\fP setting has a \(aqusers\(aq database
+defined, name the fixture \fBmydata.users.json\fP or
+\fBmydata.users.json.gz\fP and the fixture will only be loaded when you
+specify you want to load data into the \fBusers\fP database.
.SS Loading fixtures from \fBstdin\fP
.sp
You can use a dash as the fixture name to load input from \fBsys.stdin\fP\&. For
@@ -1162,11 +1157,15 @@ 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.
+.INDENT 0.0
+.TP
+.B \-\-scriptable
+.UNINDENT
.sp
-Support for calling \fBmakemigrations\fP without an active database
-connection was added. In that case, check for a consistent migration
-history is skipped.
+.sp
+Diverts log output and input prompts to \fBstderr\fP, writing only paths of
+generated migration files to \fBstdout\fP\&.
.SS \fBmigrate\fP
.INDENT 0.0
.TP
@@ -1264,6 +1263,35 @@ content types.
.sp
Makes \fBmigrate\fP exit with a non\-zero status when unapplied migrations are
detected.
+.INDENT 0.0
+.TP
+.B \-\-prune
+.UNINDENT
+.sp
+
+.sp
+Deletes nonexistent migrations from the \fBdjango_migrations\fP table. This is
+useful when migration files replaced by a squashed migration have been removed.
+See migration\-squashing for more details.
+.SS \fBoptimizemigration\fP
+.sp
+
+.INDENT 0.0
+.TP
+.B django\-admin optimizemigration app_label migration_name
+.UNINDENT
+.sp
+Optimizes the operations for the named migration and overrides the existing
+file. If the migration contains functions that must be manually copied, the
+command creates a new migration file suffixed with \fB_optimized\fP that is meant
+to replace the named migration.
+.INDENT 0.0
+.TP
+.B \-\-check
+.UNINDENT
+.sp
+Makes \fBoptimizemigration\fP exit with a non\-zero status when a migration can be
+optimized.
.SS \fBrunserver\fP
.INDENT 0.0
.TP
@@ -1815,7 +1843,7 @@ zip files, you can use a URL like:
.sp
.nf
.ft C
-django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-template/archive/master.zip myapp
+django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-template/archive/main.zip myapp
.ft P
.fi
.UNINDENT
@@ -2170,8 +2198,6 @@ as \fI\%unittest\(aqs \-\-buffer option\fP\&.
.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.
@@ -2180,8 +2206,6 @@ tests, which allows it to print a traceback if the interpreter crashes. Pass
.B \-\-timing
.UNINDENT
.sp
-
-.sp
Outputs timings, including database setup and total run time.
.SS \fBtestserver\fP
.INDENT 0.0
@@ -2641,9 +2665,6 @@ 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
@@ -2814,6 +2835,39 @@ with \fBsql\fP\&.
.UNINDENT
.sp
See /howto/custom\-management\-commands for how to add customized actions.
+.SS Black formatting
+.sp
+
+.sp
+The Python files created by \fI\%startproject\fP, \fI\%startapp\fP,
+\fI\%optimizemigration\fP, \fI\%makemigrations\fP, and
+\fI\%squashmigrations\fP are formatted using the \fBblack\fP command if it is
+present on your \fBPATH\fP\&.
+.sp
+If you have \fBblack\fP globally installed, but do not wish it used for the
+current project, you can set the \fBPATH\fP explicitly:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+PATH=path/to/venv/bin django\-admin makemigrations
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.sp
+For commands using \fBstdout\fP you can pipe the output to \fBblack\fP if needed:
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+django\-admin inspectdb | black \-
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
.INDENT 0.0
.TP
.B django.core.management.call_command(name, *args, **options)