@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
2727.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
2828.in \\n[ rst2man-indent\\n[ rst2man-indent-level ] ]u
2929..
30- .TH "DJANGO-ADMIN" "1" "January 15 , 2025" "5.2 " "Django"
30+ .TH "DJANGO-ADMIN" "1" "September 17 , 2025" "6.0 " "Django"
3131.SH NAME
3232django-admin \- Utility script for the Django web framework
3333.sp
@@ -83,8 +83,8 @@ Run \fBdjango\-admin help <command>\fP to display a description of the given
8383command and a list of its available options.
8484.SS App names
8585.sp
86- Many commands take a list of \(dq app names.\(dq An \(dq app name\(dq is the basename of
87- the package containing your models. For example, if your \fI \% INSTALLED_APPS \fP
86+ Many commands take a list of \(dq app names.\(dq An \(dq app name\(dq is the basename of the
87+ package containing your models. For example, if your \fI \% INSTALLED_APPS \fP
8888contains the string \fB \(aq mysite.blog \(aq \fP , the app name is \fB blog \fP \& .
8989.SS Determining the version
9090.INDENT 0.0
@@ -173,13 +173,14 @@ Lists all available tags.
173173.B \-\- deploy
174174.UNINDENT
175175.sp
176- Activates some additional checks that are only relevant in a deployment setting.
176+ Activates some additional checks that are only relevant in a deployment
177+ setting.
177178.sp
178179You can use this option in your local development environment, but since your
179- local development settings module may not have many of your production settings,
180- you will probably want to point the \fB check \fP command at a different settings
181- module, either by setting the \fI \% DJANGO_SETTINGS_MODULE \fP environment
182- variable, or by passing the \fB \-\- settings \fP option:
180+ local development settings module may not have many of your production
181+ settings, you will probably want to point the \fB check \fP command at a different
182+ settings module, either by setting the \fI \% DJANGO_SETTINGS_MODULE \fP
183+ environment variable, or by passing the \fB \-\- settings \fP option:
183184.INDENT 0.0
184185.INDENT 3.5
185186.sp
@@ -414,8 +415,8 @@ When result of \fBdumpdata\fP is saved as a file, it can serve as a
414415.sp
415416Note that \fB dumpdata \fP uses the default manager on the model for selecting the
416417records to dump. If you\(aq re using a \fI \% custom manager \fP as
417- the default manager and it filters some of the available records, not all of the
418- objects will be dumped.
418+ the default manager and it filters some of the available records, not all of
419+ the objects will be dumped.
419420.INDENT 0.0
420421.TP
421422.B \-\- all, \- a
@@ -586,12 +587,12 @@ Django doesn\(aqt create database defaults when a
586587Similarly, database defaults aren\(aq t translated to model field defaults or
587588detected in any fashion by \fB inspectdb \fP \& .
588589.sp
589- By default, \fB inspectdb \fP creates unmanaged models. That is, \fB managed = False \fP
590- in the model\(aq s \fB Meta \fP class tells Django not to manage each table\(aq s creation,
591- modification, and deletion. If you do want to allow Django to manage the
592- table\(aq s lifecycle, you\(aq ll need to change the
593- \fI \% managed \fP option to \fB True \fP (or remove
594- it because \fB True \fP is its default value).
590+ By default, \fB inspectdb \fP creates unmanaged models. That is, \fB managed =
591+ False \fP in the model\(aq s \fB Meta \fP class tells Django not to manage each table\(aq s
592+ creation, modification, and deletion. If you do want to allow Django to manage
593+ the table\(aq s lifecycle, you\(aq ll need to change the
594+ \fI \% managed \fP option to \fB True \fP (or remove it
595+ because \fB True \fP is its default value).
595596.SS Database\- specific notes
596597.SS Oracle
597598.INDENT 0.0
@@ -1108,8 +1109,8 @@ optimized.
11081109.UNINDENT
11091110.sp
11101111Starts a lightweight development web server on the local machine. By default,
1111- the server runs on port 8000 on the IP address \fB 127.0.0.1 \fP \& . You can pass in an
1112- IP address and port number explicitly.
1112+ the server runs on port 8000 on the IP address \fB 127.0.0.1 \fP \& . You can pass in
1113+ an IP address and port number explicitly.
11131114.sp
11141115If you run this script as a user with normal privileges (recommended), you
11151116might 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
12121213\fB 127.0.0.1 \fP to \fB ::1 \fP \& .
12131214.INDENT 0.0
12141215.TP
1215- .B HIDE_PRODUCTION_WARNING
1216+ .B DJANGO_RUNSERVER_HIDE_WARNING
12161217.UNINDENT
12171218.sp
12181219
@@ -1375,14 +1376,30 @@ Starts the Python interactive interpreter.
13751376.sp
13761377All models from installed apps are automatically imported into the shell
13771378environment. Models from apps listed earlier in \fI \% INSTALLED_APPS \fP take
1378- precedence. For a \fB \-\- verbosity \fP of 2 or higher, the automatically imported
1379- objects will be listed. To disable automatic importing entirely, use the
1380- \fB \-\- no \- imports \fP flag.
1379+ precedence. The following common utilities are also imported:
1380+ .INDENT 0.0
1381+ .INDENT 3.5
1382+ .sp
1383+ .EX
1384+ from django.db import connection, reset_queries, models
1385+ from django.conf import settings
1386+ from django.utils import timezone
1387+ .EE
1388+ .UNINDENT
1389+ .UNINDENT
1390+ .sp
1391+ For a \fB \-\- verbosity \fP of 2 or higher, the automatically imported objects will
1392+ be listed. To disable automatic importing entirely, use the \fB \-\- no \- imports \fP
1393+ flag.
13811394.sp
13821395See the guide on \fI \% customizing this behavior \fP to add or remove automatic imports.
13831396.sp
13841397Automatic models import was added.
13851398
1399+ .sp
1400+ Automatic imports of common utilities, such as \fB django.conf.settings \fP ,
1401+ were added.
1402+
13861403.INDENT 0.0
13871404.TP
13881405.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
14311448variable or the \fB ~/.pythonrc.py \fP script is read.
14321449.INDENT 0.0
14331450.TP
1451+ .B \-\- no\- imports
1452+ .UNINDENT
1453+ .sp
1454+
1455+ .sp
1456+ Disables the automatic import of models from \fI \% INSTALLED_APPS \fP \& .
1457+ .INDENT 0.0
1458+ .TP
14341459.B \-\- command COMMAND, \- c COMMAND
14351460.UNINDENT
14361461.sp
@@ -1560,10 +1585,10 @@ Specifies the database for which to print the SQL. Defaults to \fBdefault\fP\&.
15601585.B django\-admin squashmigrations app_label [start_migration_name] migration_name
15611586.UNINDENT
15621587.sp
1563- Squashes the migrations for \fB app_label \fP up to and including \fB migration_name \fP
1564- down into fewer migrations, if possible. The resulting squashed migrations
1565- can live alongside the unsquashed ones safely. For more information,
1566- please read \fI \% Squashing migrations \fP \& .
1588+ Squashes the migrations for \fB app_label \fP up to and including
1589+ \fB migration_name \fP down into fewer migrations, if possible. The resulting
1590+ squashed migrations can live alongside the unsquashed ones safely. For more
1591+ information, please read \fI \% Squashing migrations \fP \& .
15671592.sp
15681593When \fB start_migration_name \fP is given, Django will only include migrations
15691594starting 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/
16111636\fB models.py \fP file and other app template files. If only the app name is given,
16121637the app directory will be created in the current working directory.
16131638.sp
1614- If the optional destination is provided, Django will use that existing
1615- directory rather than creating a new one. You can use \(aq .\(aq to denote the current
1616- working directory.
1639+ If the optional destination is provided, Django will use that name instead. If
1640+ the directory with the given name doesn\(aq t exist, it will be created. You can
1641+ use \(aq .\(aq to denote the current working directory.
1642+ .sp
1643+ Automatic creation of the destination directory was added.
1644+
16171645.sp
16181646For example:
16191647.INDENT 0.0
@@ -1659,6 +1687,18 @@ django\-admin startapp \-\-template=https://github.com/githubuser/django\-app\-t
16591687 .EE
16601688.UNINDENT
16611689.UNINDENT
1690+ .sp
1691+ \fB WARNING: \fP
1692+ .INDENT 0.0
1693+ .INDENT 3.5
1694+ Templates provided via \fB \-\- template \fP are used as is. Malicious or poorly
1695+ constructed templates may introduce security weaknesses or unintended
1696+ behavior. Compressed archives may also consume excessive resources during
1697+ extraction, potentially causing crashes or hangs.
1698+ .sp
1699+ Contents of templates should be carefully inspected before use.
1700+ .UNINDENT
1701+ .UNINDENT
16621702.INDENT 0.0
16631703.TP
16641704.B \-\- extension EXTENSIONS, \- e EXTENSIONS
@@ -1750,9 +1790,13 @@ If only the project name is given, both the project directory and project
17501790package will be named \fB <projectname> \fP and the project directory
17511791will be created in the current working directory.
17521792.sp
1753- If the optional destination is provided, Django will use that existing
1754- directory as the project directory, and create \fB manage.py \fP and the project
1755- package within it. Use \(aq .\(aq to denote the current working directory.
1793+ If the optional destination is provided, Django will use that name as the
1794+ project directory, and create \fB manage.py \fP and the project package within it.
1795+ If the directory with the given name doesn\(aq t exist, it will be created. Use \(aq .\(aq
1796+ to denote the current working directory.
1797+ .sp
1798+ Automatic creation of the destination directory was added.
1799+
17561800.sp
17571801For example:
17581802.INDENT 0.0
@@ -1769,7 +1813,10 @@ django\-admin startproject myproject /Users/jezdez/Code/myproject_repo
17691813.UNINDENT
17701814.sp
17711815Specifies a directory, file path, or URL of a custom project template. See the
1772- \fI \% startapp \-\- template \fP documentation for examples and usage.
1816+ \fI \% startapp \-\- template \fP documentation for examples and usage. The same
1817+ \fB security considerations \fP described for \fB startapp \fP templates apply here:
1818+ malicious or poorly constructed templates may introduce weaknesses or consume
1819+ excessive resources, and templates should be carefully inspected before use.
17731820.INDENT 0.0
17741821.TP
17751822.B \-\- extension EXTENSIONS, \- e EXTENSIONS
@@ -2023,13 +2070,6 @@ Outputs timings, including database setup and total run time.
20232070.UNINDENT
20242071.sp
20252072Shows the N slowest test cases (N=0 for all).
2026- .INDENT 0.0
2027- .INDENT 3.5
2028- .IP " Python 3.12 and later"
2029- .sp
2030- This feature is only available for Python 3.12 and later.
2031- .UNINDENT
2032- .UNINDENT
20332073.SS \fB testserver \fP
20342074.INDENT 0.0
20352075.TP
@@ -2064,15 +2104,15 @@ this newly created test database instead of your production database.
20642104This is useful in a number of ways:
20652105.INDENT 0.0
20662106.IP \(bu 2
2067- When you\(aq re writing \fI \% unit tests \fP of how your views
2068- act with certain fixture data, you can use \fB testserver \fP to interact with
2069- the views in a web browser, manually.
2107+ When you\(aq re writing \fI \% unit tests \fP of how your
2108+ views act with certain fixture data, you can use \fB testserver \fP to interact
2109+ with the views in a web browser, manually.
20702110.IP \(bu 2
20712111Let\(aq s say you\(aq re developing your Django application and have a \(dq pristine\(dq
20722112copy of a database that you\(aq d like to interact with. You can dump your
20732113database to a \fI \% fixture \fP (using the
20742114\fI \% dumpdata \fP command, explained above), then use \fB testserver \fP to run
2075- your web application with that data. With this arrangement, you have the
2115+ your web application with that data. With this arrangement, you have the
20762116flexibility of messing up your data in any way, knowing that whatever data
20772117changes you\(aq re making are only being made to a test database.
20782118.UNINDENT
@@ -2213,10 +2253,10 @@ it when running interactively.
22132253.sp
22142254Specifies the database into which the superuser object will be saved.
22152255.sp
2216- You can subclass the management command and override \fB get_input_data() \fP if you
2217- want to customize data input and validation. Consult the source code for
2218- details on the existing implementation and the method\(aq s parameters. For example,
2219- it could be useful if you have a \fB ForeignKey \fP in
2256+ You can subclass the management command and override \fB get_input_data() \fP if
2257+ you want to customize data input and validation. Consult the source code for
2258+ details on the existing implementation and the method\(aq s parameters. For
2259+ example, it could be useful if you have a \fB ForeignKey \fP in
22202260\fI \% REQUIRED_FIELDS \fP and want to
22212261allow creating an instance instead of entering the primary key of an existing
22222262instance.
@@ -2273,7 +2313,8 @@ Please refer to its \fI\%description\fP in the
22732313.sp
22742314This command is only available if the \fI \% static files application \fP (\fB django.contrib.staticfiles \fP ) is installed.
22752315.sp
2276- Please refer to its \fI \% description \fP in the \fI \% staticfiles \fP documentation.
2316+ Please refer to its \fI \% description \fP in the
2317+ \fI \% staticfiles \fP documentation.
22772318.SH DEFAULT OPTIONS
22782319.sp
22792320Although some commands may allow their own custom options, every command
@@ -2375,7 +2416,7 @@ django\-admin migrate \-\-verbosity 2
23752416.B \-\- no\- color
23762417.UNINDENT
23772418.sp
2378- Disables colorized command output. Some commands format their output to be
2419+ Disables colorized command output. Some commands format their output to be
23792420colorized. For example, errors will be printed to the console in red and SQL
23802421statements will be syntax highlighted.
23812422.sp
@@ -2609,8 +2650,8 @@ overridden as specified.
26092650.SS Bash completion
26102651.sp
26112652If you use the Bash shell, consider installing the Django bash completion
2612- 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
2613- distribution. It enables tab\- completion of \fB django \- admin \fP and
2653+ 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
2654+ source distribution. It enables tab\- completion of \fB django \- admin \fP and
26142655\fB manage.py \fP commands, so you can, for instance...
26152656.INDENT 0.0
26162657.IP \(bu 2
@@ -2690,7 +2731,8 @@ management.call_command(loaddata.Command(), \(dqtest_data\(dq, verbosity=0)
26902731.UNINDENT
26912732.sp
26922733Note that command options that take no arguments are passed as keywords
2693- with \fB True \fP or \fB False \fP , as you can see with the \fB interactive \fP option above.
2734+ with \fB True \fP or \fB False \fP , as you can see with the \fB interactive \fP option
2735+ above.
26942736.sp
26952737Named arguments can be passed by using either one of the following syntaxes:
26962738.INDENT 0.0
0 commit comments