1
0
mirror of https://github.com/django/django.git synced 2025-10-09 14:59:24 +00:00

Updated man page for Django 6.0 alpha 1.

This commit is contained in:
Natalia 2025-09-16 23:09:11 -03:00 committed by nessita
parent b931156c20
commit 4e1aebffdd

View File

@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
.. ..
.TH "DJANGO-ADMIN" "1" "January 15, 2025" "5.2" "Django" .TH "DJANGO-ADMIN" "1" "September 17, 2025" "6.0" "Django"
.SH NAME .SH NAME
django-admin \- Utility script for the Django web framework django-admin \- Utility script for the Django web framework
.sp .sp
@ -83,8 +83,8 @@ Run \fBdjango\-admin help <command>\fP to display a description of the given
command and a list of its available options. command and a list of its available options.
.SS App names .SS App names
.sp .sp
Many commands take a list of \(dqapp names.\(dq An \(dqapp name\(dq is the basename of Many commands take a list of \(dqapp names.\(dq An \(dqapp name\(dq is the basename of the
the package containing your models. For example, if your \fI\%INSTALLED_APPS\fP package containing your models. For example, if your \fI\%INSTALLED_APPS\fP
contains the string \fB\(aqmysite.blog\(aq\fP, the app name is \fBblog\fP\&. contains the string \fB\(aqmysite.blog\(aq\fP, the app name is \fBblog\fP\&.
.SS Determining the version .SS Determining the version
.INDENT 0.0 .INDENT 0.0
@ -173,13 +173,14 @@ Lists all available tags.
.B \-\-deploy .B \-\-deploy
.UNINDENT .UNINDENT
.sp .sp
Activates some additional checks that are only relevant in a deployment setting. Activates some additional checks that are only relevant in a deployment
setting.
.sp .sp
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
you will probably want to point the \fBcheck\fP command at a different settings settings, you will probably want to point the \fBcheck\fP command at a different
module, either by setting the \fI\%DJANGO_SETTINGS_MODULE\fP environment settings module, either by setting the \fI\%DJANGO_SETTINGS_MODULE\fP
variable, or by passing the \fB\-\-settings\fP option: environment variable, or by passing the \fB\-\-settings\fP option:
.INDENT 0.0 .INDENT 0.0
.INDENT 3.5 .INDENT 3.5
.sp .sp
@ -414,8 +415,8 @@ When result of \fBdumpdata\fP is saved as a file, it can serve as a
.sp .sp
Note that \fBdumpdata\fP uses the default manager on the model for selecting the Note that \fBdumpdata\fP uses the default manager on the model for selecting the
records to dump. If you\(aqre using a \fI\%custom manager\fP as records to dump. If you\(aqre using a \fI\%custom manager\fP as
the default manager and it filters some of the available records, not all of the the default manager and it filters some of the available records, not all of
objects will be dumped. the objects will be dumped.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-all, \-a .B \-\-all, \-a
@ -586,12 +587,12 @@ Django doesn\(aqt create database defaults when a
Similarly, database defaults aren\(aqt translated to model field defaults or Similarly, database defaults aren\(aqt translated to model field defaults or
detected in any fashion by \fBinspectdb\fP\&. detected in any fashion by \fBinspectdb\fP\&.
.sp .sp
By default, \fBinspectdb\fP creates unmanaged models. That is, \fBmanaged = False\fP By default, \fBinspectdb\fP creates unmanaged models. That is, \fBmanaged =
in the model\(aqs \fBMeta\fP class tells Django not to manage each table\(aqs creation, False\fP in the model\(aqs \fBMeta\fP class tells Django not to manage each table\(aqs
modification, and deletion. If you do want to allow Django to manage the creation, modification, and deletion. If you do want to allow Django to manage
table\(aqs lifecycle, you\(aqll need to change the the table\(aqs lifecycle, you\(aqll need to change the
\fI\%managed\fP option to \fBTrue\fP (or remove \fI\%managed\fP option to \fBTrue\fP (or remove it
it because \fBTrue\fP is its default value). because \fBTrue\fP is its default value).
.SS Database\-specific notes .SS Database\-specific notes
.SS Oracle .SS Oracle
.INDENT 0.0 .INDENT 0.0
@ -1108,8 +1109,8 @@ optimized.
.UNINDENT .UNINDENT
.sp .sp
Starts a lightweight development web server on the local machine. By default, Starts a lightweight development web server on the local machine. By default,
the server runs on port 8000 on the IP address \fB127.0.0.1\fP\&. You can pass in an the server runs on port 8000 on the IP address \fB127.0.0.1\fP\&. You can pass in
IP address and port number explicitly. an IP address and port number explicitly.
.sp .sp
If you run this script as a user with normal privileges (recommended), you If you run this script as a user with normal privileges (recommended), you
might not have access to start a port on a low port number. Low port numbers might not have access to start a port on a low port number. Low port numbers
@ -1212,7 +1213,7 @@ Uses IPv6 for the development server. This changes the default IP address from
\fB127.0.0.1\fP to \fB::1\fP\&. \fB127.0.0.1\fP to \fB::1\fP\&.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B HIDE_PRODUCTION_WARNING .B DJANGO_RUNSERVER_HIDE_WARNING
.UNINDENT .UNINDENT
.sp .sp
@ -1375,14 +1376,30 @@ Starts the Python interactive interpreter.
.sp .sp
All models from installed apps are automatically imported into the shell All models from installed apps are automatically imported into the shell
environment. Models from apps listed earlier in \fI\%INSTALLED_APPS\fP take environment. Models from apps listed earlier in \fI\%INSTALLED_APPS\fP take
precedence. For a \fB\-\-verbosity\fP of 2 or higher, the automatically imported precedence. The following common utilities are also imported:
objects will be listed. To disable automatic importing entirely, use the .INDENT 0.0
\fB\-\-no\-imports\fP flag. .INDENT 3.5
.sp
.EX
from django.db import connection, reset_queries, models
from django.conf import settings
from django.utils import timezone
.EE
.UNINDENT
.UNINDENT
.sp
For a \fB\-\-verbosity\fP of 2 or higher, the automatically imported objects will
be listed. To disable automatic importing entirely, use the \fB\-\-no\-imports\fP
flag.
.sp .sp
See the guide on \fI\%customizing this behavior\fP to add or remove automatic imports. See the guide on \fI\%customizing this behavior\fP to add or remove automatic imports.
.sp .sp
Automatic models import was added. Automatic models import was added.
.sp
Automatic imports of common utilities, such as \fBdjango.conf.settings\fP,
were added.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-interface {ipython,bpython,python}, \-i {ipython,bpython,python} .B \-\-interface {ipython,bpython,python}, \-i {ipython,bpython,python}
@ -1431,6 +1448,14 @@ default, the script pointed to by the \X'tty: link https://docs.python.org/3/usi
variable or the \fB~/.pythonrc.py\fP script is read. variable or the \fB~/.pythonrc.py\fP script is read.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-no\-imports
.UNINDENT
.sp
.sp
Disables the automatic import of models from \fI\%INSTALLED_APPS\fP\&.
.INDENT 0.0
.TP
.B \-\-command COMMAND, \-c COMMAND .B \-\-command COMMAND, \-c COMMAND
.UNINDENT .UNINDENT
.sp .sp
@ -1560,10 +1585,10 @@ Specifies the database for which to print the SQL. Defaults to \fBdefault\fP\&.
.B django\-admin squashmigrations app_label [start_migration_name] migration_name .B django\-admin squashmigrations app_label [start_migration_name] migration_name
.UNINDENT .UNINDENT
.sp .sp
Squashes the migrations for \fBapp_label\fP up to and including \fBmigration_name\fP Squashes the migrations for \fBapp_label\fP up to and including
down into fewer migrations, if possible. The resulting squashed migrations \fBmigration_name\fP down into fewer migrations, if possible. The resulting
can live alongside the unsquashed ones safely. For more information, squashed migrations can live alongside the unsquashed ones safely. For more
please read \fI\%Squashing migrations\fP\&. information, please read \fI\%Squashing migrations\fP\&.
.sp .sp
When \fBstart_migration_name\fP is given, Django will only include migrations When \fBstart_migration_name\fP is given, Django will only include migrations
starting from and including this migration. This helps to mitigate the starting from and including this migration. This helps to mitigate the
@ -1611,9 +1636,12 @@ By default, \X'tty: link https://github.com/django/django/blob/main/django/conf/
\fBmodels.py\fP file and other app template files. If only the app name is given, \fBmodels.py\fP file and other app template files. If only the app name is given,
the app directory will be created in the current working directory. the app directory will be created in the current working directory.
.sp .sp
If the optional destination is provided, Django will use that existing If the optional destination is provided, Django will use that name instead. If
directory rather than creating a new one. You can use \(aq.\(aq to denote the current the directory with the given name doesn\(aqt exist, it will be created. You can
working directory. use \(aq.\(aq to denote the current working directory.
.sp
Automatic creation of the destination directory was added.
.sp .sp
For example: For example:
.INDENT 0.0 .INDENT 0.0
@ -1659,6 +1687,18 @@ django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-t
.EE .EE
.UNINDENT .UNINDENT
.UNINDENT .UNINDENT
.sp
\fBWARNING:\fP
.INDENT 0.0
.INDENT 3.5
Templates provided via \fB\-\-template\fP are used as is. Malicious or poorly
constructed templates may introduce security weaknesses or unintended
behavior. Compressed archives may also consume excessive resources during
extraction, potentially causing crashes or hangs.
.sp
Contents of templates should be carefully inspected before use.
.UNINDENT
.UNINDENT
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-extension EXTENSIONS, \-e EXTENSIONS .B \-\-extension EXTENSIONS, \-e EXTENSIONS
@ -1750,9 +1790,13 @@ If only the project name is given, both the project directory and project
package will be named \fB<projectname>\fP and the project directory package will be named \fB<projectname>\fP and the project directory
will be created in the current working directory. will be created in the current working directory.
.sp .sp
If the optional destination is provided, Django will use that existing If the optional destination is provided, Django will use that name as the
directory as the project directory, and create \fBmanage.py\fP and the project project directory, and create \fBmanage.py\fP and the project package within it.
package within it. Use \(aq.\(aq to denote the current working directory. If the directory with the given name doesn\(aqt exist, it will be created. Use \(aq.\(aq
to denote the current working directory.
.sp
Automatic creation of the destination directory was added.
.sp .sp
For example: For example:
.INDENT 0.0 .INDENT 0.0
@ -1769,7 +1813,10 @@ django\-admin startproject myproject /Users/jezdez/Code/myproject_repo
.UNINDENT .UNINDENT
.sp .sp
Specifies a directory, file path, or URL of a custom project template. See the Specifies a directory, file path, or URL of a custom project template. See the
\fI\%startapp \-\-template\fP documentation for examples and usage. \fI\%startapp \-\-template\fP documentation for examples and usage. The same
\fBsecurity considerations\fP described for \fBstartapp\fP templates apply here:
malicious or poorly constructed templates may introduce weaknesses or consume
excessive resources, and templates should be carefully inspected before use.
.INDENT 0.0 .INDENT 0.0
.TP .TP
.B \-\-extension EXTENSIONS, \-e EXTENSIONS .B \-\-extension EXTENSIONS, \-e EXTENSIONS
@ -2023,13 +2070,6 @@ Outputs timings, including database setup and total run time.
.UNINDENT .UNINDENT
.sp .sp
Shows the N slowest test cases (N=0 for all). Shows the N slowest test cases (N=0 for all).
.INDENT 0.0
.INDENT 3.5
.IP "Python 3.12 and later"
.sp
This feature is only available for Python 3.12 and later.
.UNINDENT
.UNINDENT
.SS \fBtestserver\fP .SS \fBtestserver\fP
.INDENT 0.0 .INDENT 0.0
.TP .TP
@ -2064,15 +2104,15 @@ this newly created test database instead of your production database.
This is useful in a number of ways: This is useful in a number of ways:
.INDENT 0.0 .INDENT 0.0
.IP \(bu 2 .IP \(bu 2
When you\(aqre writing \fI\%unit tests\fP of how your views When you\(aqre writing \fI\%unit tests\fP of how your
act with certain fixture data, you can use \fBtestserver\fP to interact with views act with certain fixture data, you can use \fBtestserver\fP to interact
the views in a web browser, manually. with the views in a web browser, manually.
.IP \(bu 2 .IP \(bu 2
Let\(aqs say you\(aqre developing your Django application and have a \(dqpristine\(dq Let\(aqs say you\(aqre developing your Django application and have a \(dqpristine\(dq
copy of a database that you\(aqd like to interact with. You can dump your copy of a database that you\(aqd like to interact with. You can dump your
database to a \fI\%fixture\fP (using the database to a \fI\%fixture\fP (using the
\fI\%dumpdata\fP command, explained above), then use \fBtestserver\fP to run \fI\%dumpdata\fP command, explained above), then use \fBtestserver\fP to run
your web application with that data. With this arrangement, you have the your web application with that data. With this arrangement, you have the
flexibility of messing up your data in any way, knowing that whatever data flexibility of messing up your data in any way, knowing that whatever data
changes you\(aqre making are only being made to a test database. changes you\(aqre making are only being made to a test database.
.UNINDENT .UNINDENT
@ -2213,10 +2253,10 @@ it when running interactively.
.sp .sp
Specifies the database into which the superuser object will be saved. Specifies the database into which the superuser object will be saved.
.sp .sp
You can subclass the management command and override \fBget_input_data()\fP if you You can subclass the management command and override \fBget_input_data()\fP if
want to customize data input and validation. Consult the source code for you want to customize data input and validation. Consult the source code for
details on the existing implementation and the method\(aqs parameters. For example, details on the existing implementation and the method\(aqs parameters. For
it could be useful if you have a \fBForeignKey\fP in example, it could be useful if you have a \fBForeignKey\fP in
\fI\%REQUIRED_FIELDS\fP and want to \fI\%REQUIRED_FIELDS\fP and want to
allow creating an instance instead of entering the primary key of an existing allow creating an instance instead of entering the primary key of an existing
instance. instance.
@ -2273,7 +2313,8 @@ Please refer to its \fI\%description\fP in the
.sp .sp
This command is only available if the \fI\%static files application\fP (\fBdjango.contrib.staticfiles\fP) is installed. This command is only available if the \fI\%static files application\fP (\fBdjango.contrib.staticfiles\fP) is installed.
.sp .sp
Please refer to its \fI\%description\fP in the \fI\%staticfiles\fP documentation. Please refer to its \fI\%description\fP in the
\fI\%staticfiles\fP documentation.
.SH DEFAULT OPTIONS .SH DEFAULT OPTIONS
.sp .sp
Although some commands may allow their own custom options, every command Although some commands may allow their own custom options, every command
@ -2375,7 +2416,7 @@ django\-admin migrate \-\-verbosity 2
.B \-\-no\-color .B \-\-no\-color
.UNINDENT .UNINDENT
.sp .sp
Disables colorized command output. Some commands format their output to be Disables colorized command output. Some commands format their output to be
colorized. For example, errors will be printed to the console in red and SQL colorized. For example, errors will be printed to the console in red and SQL
statements will be syntax highlighted. statements will be syntax highlighted.
.sp .sp
@ -2609,8 +2650,8 @@ overridden as specified.
.SS Bash completion .SS Bash completion
.sp .sp
If you use the Bash shell, consider installing the Django bash completion If you use the Bash shell, consider installing the Django bash completion
script, which lives in \X'tty: link https://github.com/django/django/blob/main/extras/django_bash_completion'\fI\%extras/django_bash_completion\fP\X'tty: link' in the Django source script, which lives in \X'tty: link https://github.com/django/django/blob/main/extras/django_bash_completion'\fI\%extras/django_bash_completion\fP\X'tty: link' in the Django
distribution. It enables tab\-completion of \fBdjango\-admin\fP and source distribution. It enables tab\-completion of \fBdjango\-admin\fP and
\fBmanage.py\fP commands, so you can, for instance... \fBmanage.py\fP commands, so you can, for instance...
.INDENT 0.0 .INDENT 0.0
.IP \(bu 2 .IP \(bu 2
@ -2690,7 +2731,8 @@ management.call_command(loaddata.Command(), \(dqtest_data\(dq, verbosity=0)
.UNINDENT .UNINDENT
.sp .sp
Note that command options that take no arguments are passed as keywords Note that command options that take no arguments are passed as keywords
with \fBTrue\fP or \fBFalse\fP, as you can see with the \fBinteractive\fP option above. with \fBTrue\fP or \fBFalse\fP, as you can see with the \fBinteractive\fP option
above.
.sp .sp
Named arguments can be passed by using either one of the following syntaxes: Named arguments can be passed by using either one of the following syntaxes:
.INDENT 0.0 .INDENT 0.0