{"title":"django-admin and manage.py","version":"2.1","locale":"pl","docname":"ref/django-admin","url":"/pl/2.1/ref/django-admin/","canonical":"https://djangodocs.dev/pl/2.1/ref/django-admin/","summary":"django-admin is Django’s command-line utility for administrative tasks. This document outlines all it can do.","html":"<section id=\"django-admin-and-manage-py\">\n<h1><code class=\"docutils literal notranslate\">django-admin</code> and <code class=\"docutils literal notranslate\">manage.py</code><a class=\"heading-anchor\" href=\"#django-admin-and-manage-py\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p><code class=\"docutils literal notranslate\">django-admin</code> is Django’s command-line utility for administrative tasks.\nThis document outlines all it can do.</p>\n<p>In addition, <code class=\"docutils literal notranslate\">manage.py</code> is automatically created in each Django project.\n<code class=\"docutils literal notranslate\">manage.py</code> does the same thing as <code class=\"docutils literal notranslate\">django-admin</code> but takes care of a few\nthings for you:</p>\n<ul class=\"simple\">\n<li><p>It puts your project’s package on <code class=\"docutils literal notranslate\">sys.path</code>.</p></li>\n<li><p>It sets the <span class=\"target\" id=\"index-0\"></span><a class=\"reference internal\" href=\"/pl/2.1/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code></a> environment variable so that\nit points to your project’s <code class=\"docutils literal notranslate\">settings.py</code> file.</p></li>\n</ul>\n<p>The <code class=\"docutils literal notranslate\">django-admin</code> script should be on your system path if you installed\nDjango via its <code class=\"docutils literal notranslate\">setup.py</code> utility. If it’s not on your path, you can find it\nin <code class=\"docutils literal notranslate\">site-packages/django/bin</code> within your Python installation. Consider\nsymlinking it from some place on your path, such as <code class=\"docutils literal notranslate\">/usr/local/bin</code>.</p>\n<p>For Windows users, who do not have symlinking functionality available, you can\ncopy <code class=\"docutils literal notranslate\">django-admin.exe</code> to a location on your existing path or edit the\n<code class=\"docutils literal notranslate\">PATH</code> settings (under <code class=\"docutils literal notranslate\">Settings - Control Panel - System - Advanced -\nEnvironment...</code>) to point to its installed location.</p>\n<p>Generally, when working on a single Django project, it’s easier to use\n<code class=\"docutils literal notranslate\">manage.py</code> than <code class=\"docutils literal notranslate\">django-admin</code>. If you need to switch between multiple\nDjango settings files, use <code class=\"docutils literal notranslate\">django-admin</code> with\n<span class=\"target\" id=\"index-1\"></span><a class=\"reference internal\" href=\"/pl/2.1/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code></a> or the <a class=\"reference internal\" href=\"#cmdoption-settings\"><code class=\"xref std std-option docutils literal notranslate\">--settings</code></a> command line\noption.</p>\n<p>The command-line examples throughout this document use <code class=\"docutils literal notranslate\">django-admin</code> to\nbe consistent, but any example can use <code class=\"docutils literal notranslate\">manage.py</code> or <code class=\"docutils literal notranslate\">python -m django</code>\njust as well.</p>\n<section id=\"usage\">\n<h2>Usage<a class=\"heading-anchor\" href=\"#usage\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-0-unix-label\">Linux / macOS</p><div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>django-admin &lt;command&gt; <span class=\"o\">[</span>options<span class=\"o\">]</span>\n<span class=\"gp\">$ </span>manage.py &lt;command&gt; <span class=\"o\">[</span>options<span class=\"o\">]</span>\n<span class=\"gp\">$ </span>python -m django &lt;command&gt; <span class=\"o\">[</span>options<span class=\"o\">]</span>\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-0-windows-label\">Windows</p><div class=\"code-block\" data-language=\"doscon\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Windows</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Windows shell\"><code><span class=\"gp\">...\\&gt;</span> django-admin <span class=\"p\">&lt;</span>command<span class=\"p\">&gt;</span> [options]\n<span class=\"gp\">...\\&gt;</span> manage.py <span class=\"p\">&lt;</span>command<span class=\"p\">&gt;</span> [options]\n<span class=\"gp\">...\\&gt;</span> py -m django <span class=\"p\">&lt;</span>command<span class=\"p\">&gt;</span> [options]\n</code></pre></div></div></div>\n<p><code class=\"docutils literal notranslate\">command</code> should be one of the commands listed in this document.\n<code class=\"docutils literal notranslate\">options</code>, which is optional, should be zero or more of the options available\nfor the given command.</p>\n<section id=\"getting-runtime-help\">\n<h3>Getting runtime help<a class=\"heading-anchor\" href=\"#getting-runtime-help\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-help\">\n<span class=\"sig-name descname\">django-admin help</span><a class=\"heading-anchor\" href=\"#django-admin-help\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Run <code class=\"docutils literal notranslate\">django-admin help</code> to display usage information and a list of the\ncommands provided by each application.</p>\n<p>Run <code class=\"docutils literal notranslate\">django-admin help --commands</code> to display a list of all available\ncommands.</p>\n<p>Run <code class=\"docutils literal notranslate\">django-admin help &lt;command&gt;</code> to display a description of the given\ncommand and a list of its available options.</p>\n</section>\n<section id=\"app-names\">\n<h3>App names<a class=\"heading-anchor\" href=\"#app-names\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Many commands take a list of „app names.” An „app name” is the basename of\nthe package containing your models. For example, if your <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>\ncontains the string <code class=\"docutils literal notranslate\">'mysite.blog'</code>, the app name is <code class=\"docutils literal notranslate\">blog</code>.</p>\n</section>\n<section id=\"determining-the-version\">\n<h3>Determining the version<a class=\"heading-anchor\" href=\"#determining-the-version\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-version\">\n<span class=\"sig-name descname\">django-admin version</span><a class=\"heading-anchor\" href=\"#django-admin-version\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Run <code class=\"docutils literal notranslate\">django-admin version</code> to display the current Django version.</p>\n<p>The output follows the schema described in <span class=\"target\" id=\"index-2\"></span><a class=\"pep reference external\" href=\"https://peps.python.org/pep-0440/\"><strong>PEP 440</strong></a>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"mf\">1.4</span><span class=\"o\">.</span>dev17026\n<span class=\"mf\">1.4</span>a1\n<span class=\"mf\">1.4</span>\n</code></pre></div>\n</section>\n<section id=\"displaying-debug-output\">\n<h3>Displaying debug output<a class=\"heading-anchor\" href=\"#displaying-debug-output\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Use <a class=\"reference internal\" href=\"#cmdoption-verbosity\"><code class=\"xref std std-option docutils literal notranslate\">--verbosity</code></a> to specify the amount of notification and debug\ninformation that <code class=\"docutils literal notranslate\">django-admin</code> prints to the console.</p>\n</section>\n</section>\n<section id=\"available-commands\">\n<h2>Available commands<a class=\"heading-anchor\" href=\"#available-commands\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"check\">\n<h3><code class=\"docutils literal notranslate\">check</code><a class=\"heading-anchor\" href=\"#check\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-check\">\n<span class=\"sig-name descname\">django-admin check [app_label [app_label ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-check\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Uses the <a class=\"reference internal\" href=\"/pl/2.1/ref/checks/\"><span class=\"doc\">system check framework</span></a> to inspect the entire\nDjango project for common problems.</p>\n<p>By default, all apps will be checked. You can check a subset of apps by\nproviding a list of app labels as arguments:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin check auth admin myapp\n</code></pre></div>\n<p>If you do not specify any app, all apps will be checked.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-tag\">\n<span id=\"cmdoption-check-t\"></span><span class=\"sig-name descname\">--tag</span><span class=\"sig-prename descclassname\"> TAGS</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-t</span><span class=\"sig-prename descclassname\"> TAGS</span><a class=\"heading-anchor\" href=\"#cmdoption-check-tag\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>The system check framework performs many different types of checks that are\n<a class=\"reference internal\" href=\"/pl/2.1/ref/checks/#system-check-builtin-tags\"><span class=\"std std-ref\">categorized with tags</span></a>. You can use these\ntags to restrict the checks performed to just those in a particular category.\nFor example, to perform only models and compatibility checks, run:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin check <span class=\"o\">--</span>tag models <span class=\"o\">--</span>tag compatibility\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-list-tags\">\n<span class=\"sig-name descname\">--list-tags</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-check-list-tags\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Lists all available tags.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-deploy\">\n<span class=\"sig-name descname\">--deploy</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-check-deploy\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Activates some additional checks that are only relevant in a deployment setting.</p>\n<p>You can use this option in your local development environment, but since your\nlocal development settings module may not have many of your production settings,\nyou will probably want to point the <code class=\"docutils literal notranslate\">check</code> command at a different settings\nmodule, either by setting the <code class=\"docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code> environment variable,\nor by passing the <code class=\"docutils literal notranslate\">--settings</code> option:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin check <span class=\"o\">--</span>deploy <span class=\"o\">--</span>settings<span class=\"o\">=</span>production_settings\n</code></pre></div>\n<p>Or you could run it directly on a production or staging deployment to verify\nthat the correct settings are in use (omitting <code class=\"docutils literal notranslate\">--settings</code>). You could even\nmake it part of your integration test suite.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-fail-level\">\n<span class=\"sig-name descname\">--fail-level</span><span class=\"sig-prename descclassname\"> {CRITICAL,ERROR,WARNING,INFO,DEBUG}</span><a class=\"heading-anchor\" href=\"#cmdoption-check-fail-level\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the message level that will cause the command to exit with a non-zero\nstatus. Default is <code class=\"docutils literal notranslate\">ERROR</code>.</p>\n</section>\n<section id=\"compilemessages\">\n<h3><code class=\"docutils literal notranslate\">compilemessages</code><a class=\"heading-anchor\" href=\"#compilemessages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-compilemessages\">\n<span class=\"sig-name descname\">django-admin compilemessages</span><a class=\"heading-anchor\" href=\"#django-admin-compilemessages\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Compiles <code class=\"docutils literal notranslate\">.po</code> files created by <a class=\"reference internal\" href=\"#django-admin-makemessages\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemessages</code></a> to <code class=\"docutils literal notranslate\">.mo</code> files for\nuse with the built-in gettext support. See <a class=\"reference internal\" href=\"/pl/2.1/topics/i18n/\"><span class=\"doc\">Unarodowienie i lokalizacja</span></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-compilemessages-locale\">\n<span id=\"cmdoption-compilemessages-l\"></span><span class=\"sig-name descname\">--locale</span><span class=\"sig-prename descclassname\"> LOCALE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-l</span><span class=\"sig-prename descclassname\"> LOCALE</span><a class=\"heading-anchor\" href=\"#cmdoption-compilemessages-locale\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the locale(s) to process. If not provided, all locales are processed.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-compilemessages-exclude\">\n<span id=\"cmdoption-compilemessages-x\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-x</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><a class=\"heading-anchor\" href=\"#cmdoption-compilemessages-exclude\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the locale(s) to exclude from processing. If not provided, no locales\nare excluded.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-compilemessages-use-fuzzy\">\n<span id=\"cmdoption-compilemessages-f\"></span><span class=\"sig-name descname\">--use-fuzzy</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-f</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-compilemessages-use-fuzzy\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Includes fuzzy translations into compiled files.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin compilemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>pt_BR\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>pt_BR <span class=\"o\">--</span>locale<span class=\"o\">=</span>fr <span class=\"o\">-</span>f\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">-</span>l pt_BR\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">-</span>l pt_BR <span class=\"o\">-</span>l fr <span class=\"o\">--</span>use<span class=\"o\">-</span>fuzzy\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">--</span>exclude<span class=\"o\">=</span>pt_BR\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">--</span>exclude<span class=\"o\">=</span>pt_BR <span class=\"o\">--</span>exclude<span class=\"o\">=</span>fr\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">-</span>x pt_BR\ndjango<span class=\"o\">-</span>admin compilemessages <span class=\"o\">-</span>x pt_BR <span class=\"o\">-</span>x fr\n</code></pre></div>\n</section>\n<section id=\"createcachetable\">\n<h3><code class=\"docutils literal notranslate\">createcachetable</code><a class=\"heading-anchor\" href=\"#createcachetable\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-createcachetable\">\n<span class=\"sig-name descname\">django-admin createcachetable</span><a class=\"heading-anchor\" href=\"#django-admin-createcachetable\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates the cache tables for use with the database cache backend using the\ninformation from your settings file. See <a class=\"reference internal\" href=\"/pl/2.1/topics/cache/\"><span class=\"doc\">Django’s cache framework</span></a> for more\ninformation.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createcachetable-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-createcachetable-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database in which the cache table(s) will be created. Defaults to\n<code class=\"docutils literal notranslate\">default</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createcachetable-dry-run\">\n<span class=\"sig-name descname\">--dry-run</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-createcachetable-dry-run\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prints the SQL that would be run without actually running it, so you can\ncustomize it or use the migrations framework.</p>\n</section>\n<section id=\"dbshell\">\n<h3><code class=\"docutils literal notranslate\">dbshell</code><a class=\"heading-anchor\" href=\"#dbshell\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-dbshell\">\n<span class=\"sig-name descname\">django-admin dbshell</span><a class=\"heading-anchor\" href=\"#django-admin-dbshell\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs the command-line client for the database engine specified in your\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-DATABASE-ENGINE\"><code class=\"xref std std-setting docutils literal notranslate\">ENGINE</code></a> setting, with the connection parameters\nspecified in your <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-USER\"><code class=\"xref std std-setting docutils literal notranslate\">USER</code></a>, <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-PASSWORD\"><code class=\"xref std std-setting docutils literal notranslate\">PASSWORD</code></a>, etc., settings.</p>\n<ul class=\"simple\">\n<li><p>For PostgreSQL, this runs the <code class=\"docutils literal notranslate\">psql</code> command-line client.</p></li>\n<li><p>For MySQL, this runs the <code class=\"docutils literal notranslate\">mysql</code> command-line client.</p></li>\n<li><p>For SQLite, this runs the <code class=\"docutils literal notranslate\">sqlite3</code> command-line client.</p></li>\n<li><p>For Oracle, this runs the <code class=\"docutils literal notranslate\">sqlplus</code> command-line client.</p></li>\n</ul>\n<p>This command assumes the programs are on your <code class=\"docutils literal notranslate\">PATH</code> so that a simple call to\nthe program name (<code class=\"docutils literal notranslate\">psql</code>, <code class=\"docutils literal notranslate\">mysql</code>, <code class=\"docutils literal notranslate\">sqlite3</code>, <code class=\"docutils literal notranslate\">sqlplus</code>) will find the\nprogram in the right place. There’s no way to specify the location of the\nprogram manually.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dbshell-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-dbshell-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database onto which to open a shell. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"diffsettings\">\n<h3><code class=\"docutils literal notranslate\">diffsettings</code><a class=\"heading-anchor\" href=\"#diffsettings\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-diffsettings\">\n<span class=\"sig-name descname\">django-admin diffsettings</span><a class=\"heading-anchor\" href=\"#django-admin-diffsettings\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Displays differences between the current settings file and Django’s default\nsettings (or another settings file specified by <a class=\"reference internal\" href=\"#cmdoption-diffsettings-default\"><code class=\"xref std std-option docutils literal notranslate\">--default</code></a>).</p>\n<p>Settings that don’t appear in the defaults are followed by <code class=\"docutils literal notranslate\">&quot;###&quot;</code>. For\nexample, the default settings don’t define <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-ROOT_URLCONF\"><code class=\"xref std std-setting docutils literal notranslate\">ROOT_URLCONF</code></a>, so\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-ROOT_URLCONF\"><code class=\"xref std std-setting docutils literal notranslate\">ROOT_URLCONF</code></a> is followed by <code class=\"docutils literal notranslate\">&quot;###&quot;</code> in the output of\n<code class=\"docutils literal notranslate\">diffsettings</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-diffsettings-all\">\n<span class=\"sig-name descname\">--all</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-diffsettings-all\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Displays all settings, even if they have Django’s default value. Such settings\nare prefixed by <code class=\"docutils literal notranslate\">&quot;###&quot;</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-diffsettings-default\">\n<span class=\"sig-name descname\">--default</span><span class=\"sig-prename descclassname\"> MODULE</span><a class=\"heading-anchor\" href=\"#cmdoption-diffsettings-default\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>The settings module to compare the current settings against. Leave empty to\ncompare against Django’s default settings.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-diffsettings-output\">\n<span class=\"sig-name descname\">--output</span><span class=\"sig-prename descclassname\"> {hash,unified}</span><a class=\"heading-anchor\" href=\"#cmdoption-diffsettings-output\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<aside class=\"version-note version-added\" data-version=\"2.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.0</p></aside>\n<p>Specifies the output format. Available values are <code class=\"docutils literal notranslate\">hash</code> and <code class=\"docutils literal notranslate\">unified</code>.\n<code class=\"docutils literal notranslate\">hash</code> is the default mode that displays the output that’s described above.\n<code class=\"docutils literal notranslate\">unified</code> displays the output similar to <code class=\"docutils literal notranslate\">diff -u</code>. Default settings are\nprefixed with a minus sign, followed by the changed setting prefixed with a\nplus sign.</p>\n</section>\n<section id=\"dumpdata\">\n<h3><code class=\"docutils literal notranslate\">dumpdata</code><a class=\"heading-anchor\" href=\"#dumpdata\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-dumpdata\">\n<span class=\"sig-name descname\">django-admin dumpdata [app_label[.ModelName] [app_label[.ModelName] ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-dumpdata\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Outputs to standard output all data in the database associated with the named\napplication(s).</p>\n<p>If no application name is provided, all installed applications will be dumped.</p>\n<p>The output of <code class=\"docutils literal notranslate\">dumpdata</code> can be used as input for <a class=\"reference internal\" href=\"#django-admin-loaddata\"><code class=\"xref std std-djadmin docutils literal notranslate\">loaddata</code></a>.</p>\n<p>Note that <code class=\"docutils literal notranslate\">dumpdata</code> uses the default manager on the model for selecting the\nrecords to dump. If you’re using a <a class=\"reference internal\" href=\"/pl/2.1/topics/db/managers/#custom-managers\"><span class=\"std std-ref\">custom manager</span></a> as\nthe default manager and it filters some of the available records, not all of the\nobjects will be dumped.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-all\">\n<span id=\"cmdoption-dumpdata-a\"></span><span class=\"sig-name descname\">--all</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-a</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-all\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Uses Django’s base manager, dumping records which might otherwise be filtered\nor modified by a custom manager.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-format\">\n<span class=\"sig-name descname\">--format</span><span class=\"sig-prename descclassname\"> FORMAT</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the serialization format of the output. Defaults to JSON. Supported\nformats are listed in <a class=\"reference internal\" href=\"/pl/2.1/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">Serialization formats</span></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-indent\">\n<span class=\"sig-name descname\">--indent</span><span class=\"sig-prename descclassname\"> INDENT</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-indent\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the number of indentation spaces to use in the output. Defaults to\n<code class=\"docutils literal notranslate\">None</code> which displays all data on single line.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-exclude\">\n<span id=\"cmdoption-dumpdata-e\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-e</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-exclude\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prevents specific applications or models (specified in the form of\n<code class=\"docutils literal notranslate\">app_label.ModelName</code>) from being dumped. If you specify a model name, the\noutput will be restricted to that model, rather than the entire application.\nYou can also mix application names and model names.</p>\n<p>If you want to exclude multiple applications, pass <code class=\"docutils literal notranslate\">--exclude</code> more than\nonce:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin dumpdata <span class=\"o\">--</span>exclude<span class=\"o\">=</span>auth <span class=\"o\">--</span>exclude<span class=\"o\">=</span>contenttypes\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database from which data will be dumped. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-natural-foreign\">\n<span class=\"sig-name descname\">--natural-foreign</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-natural-foreign\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Uses the <code class=\"docutils literal notranslate\">natural_key()</code> model method to serialize any foreign key and\nmany-to-many relationship to objects of the type that defines the method. If\nyou’re dumping <code class=\"docutils literal notranslate\">contrib.auth</code> <code class=\"docutils literal notranslate\">Permission</code> objects or\n<code class=\"docutils literal notranslate\">contrib.contenttypes</code> <code class=\"docutils literal notranslate\">ContentType</code> objects, you should probably use this\nflag. See the <a class=\"reference internal\" href=\"/pl/2.1/topics/serialization/#topics-serialization-natural-keys\"><span class=\"std std-ref\">natural keys</span></a>\ndocumentation for more details on this and the next option.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-natural-primary\">\n<span class=\"sig-name descname\">--natural-primary</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-natural-primary\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Omits the primary key in the serialized data of this object since it can be\ncalculated during deserialization.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-pks\">\n<span class=\"sig-name descname\">--pks</span><span class=\"sig-prename descclassname\"> PRIMARY_KEYS</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-pks\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Outputs only the objects specified by a comma separated list of primary keys.\nThis is only available when dumping one model. By default, all the records of\nthe model are output.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-output\">\n<span id=\"cmdoption-dumpdata-o\"></span><span class=\"sig-name descname\">--output</span><span class=\"sig-prename descclassname\"> OUTPUT</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-o</span><span class=\"sig-prename descclassname\"> OUTPUT</span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-output\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies a file to write the serialized data to. By default, the data goes to\nstandard output.</p>\n<p>When this option is set and <code class=\"docutils literal notranslate\">--verbosity</code> is greater than 0 (the default), a\nprogress bar is shown in the terminal.</p>\n</section>\n<section id=\"flush\">\n<h3><code class=\"docutils literal notranslate\">flush</code><a class=\"heading-anchor\" href=\"#flush\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-flush\">\n<span class=\"sig-name descname\">django-admin flush</span><a class=\"heading-anchor\" href=\"#django-admin-flush\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Removes all data from the database and re-executes any post-synchronization\nhandlers. The table of which migrations have been applied is not cleared.</p>\n<p>If you would rather start from an empty database and re-run all migrations, you\nshould drop and recreate the database and then run <a class=\"reference internal\" href=\"#django-admin-migrate\"><code class=\"xref std std-djadmin docutils literal notranslate\">migrate</code></a> instead.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-flush-noinput\">\n<span id=\"cmdoption-flush-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-flush-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-flush-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-flush-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to flush. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"inspectdb\">\n<h3><code class=\"docutils literal notranslate\">inspectdb</code><a class=\"heading-anchor\" href=\"#inspectdb\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-inspectdb\">\n<span class=\"sig-name descname\">django-admin inspectdb [table [table ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-inspectdb\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Introspects the database tables in the database pointed-to by the\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-NAME\"><code class=\"xref std std-setting docutils literal notranslate\">NAME</code></a> setting and outputs a Django model module (a <code class=\"docutils literal notranslate\">models.py</code>\nfile) to standard output.</p>\n<p>You may choose what tables or views to inspect by passing their names as\narguments. If no arguments are provided, models are created for views only if\nthe <a class=\"reference internal\" href=\"#cmdoption-inspectdb-include-views\"><code class=\"xref std std-option docutils literal notranslate\">--include-views</code></a> option is used.</p>\n<p>Use this if you have a legacy database with which you’d like to use Django.\nThe script will inspect the database and create a model for each table within\nit.</p>\n<p>As you might expect, the created models will have an attribute for every field\nin the table. Note that <code class=\"docutils literal notranslate\">inspectdb</code> has a few special cases in its field-name\noutput:</p>\n<ul class=\"simple\">\n<li><p>If <code class=\"docutils literal notranslate\">inspectdb</code> cannot map a column’s type to a model field type, it’ll\nuse <code class=\"docutils literal notranslate\">TextField</code> and will insert the Python comment\n<code class=\"docutils literal notranslate\">'This field type is a guess.'</code> next to the field in the generated\nmodel. The recognized fields may depend on apps listed in\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>. For example, <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/postgres/#module-django.contrib.postgres\" title=\"django.contrib.postgres: PostgreSQL-specific fields and features\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.postgres</code></a> adds\nrecognition for several PostgreSQL-specific field types.</p></li>\n<li><p>If the database column name is a Python reserved word (such as\n<code class=\"docutils literal notranslate\">'pass'</code>, <code class=\"docutils literal notranslate\">'class'</code> or <code class=\"docutils literal notranslate\">'for'</code>), <code class=\"docutils literal notranslate\">inspectdb</code> will append\n<code class=\"docutils literal notranslate\">'_field'</code> to the attribute name. For example, if a table has a column\n<code class=\"docutils literal notranslate\">'for'</code>, the generated model will have a field <code class=\"docutils literal notranslate\">'for_field'</code>, with\nthe <code class=\"docutils literal notranslate\">db_column</code> attribute set to <code class=\"docutils literal notranslate\">'for'</code>. <code class=\"docutils literal notranslate\">inspectdb</code> will insert\nthe Python comment\n<code class=\"docutils literal notranslate\">'Field renamed because it was a Python reserved word.'</code> next to the\nfield.</p></li>\n</ul>\n<p>This feature is meant as a shortcut, not as definitive model generation. After\nyou run it, you’ll want to look over the generated models yourself to make\ncustomizations. In particular, you’ll need to rearrange models» order, so that\nmodels that refer to other models are ordered properly.</p>\n<p>Django doesn’t create database defaults when a\n<a class=\"reference internal\" href=\"/pl/2.1/ref/models/fields/#django.db.models.Field.default\" title=\"django.db.models.Field.default\"><code class=\"xref py py-attr docutils literal notranslate\">default</code></a> is specified on a model field.\nSimilarly, database defaults aren’t translated to model field defaults or\ndetected in any fashion by <code class=\"docutils literal notranslate\">inspectdb</code>.</p>\n<p>By default, <code class=\"docutils literal notranslate\">inspectdb</code> creates unmanaged models. That is, <code class=\"docutils literal notranslate\">managed = False</code>\nin the model’s <code class=\"docutils literal notranslate\">Meta</code> class tells Django not to manage each table’s creation,\nmodification, and deletion. If you do want to allow Django to manage the\ntable’s lifecycle, you’ll need to change the\n<a class=\"reference internal\" href=\"/pl/2.1/ref/models/options/#django.db.models.Options.managed\" title=\"django.db.models.Options.managed\"><code class=\"xref py py-attr docutils literal notranslate\">managed</code></a> option to <code class=\"docutils literal notranslate\">True</code> (or simply remove\nit because <code class=\"docutils literal notranslate\">True</code> is its default value).</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-inspectdb-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-inspectdb-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to introspect. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-inspectdb-include-views\">\n<span class=\"sig-name descname\">--include-views</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-inspectdb-include-views\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<aside class=\"version-note version-added\" data-version=\"2.1\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.1</p></aside>\n<p>If this option is provided, models are also created for database views.</p>\n</section>\n<section id=\"loaddata\">\n<h3><code class=\"docutils literal notranslate\">loaddata</code><a class=\"heading-anchor\" href=\"#loaddata\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-loaddata\">\n<span class=\"sig-name descname\">django-admin loaddata fixture [fixture ...]</span><a class=\"heading-anchor\" href=\"#django-admin-loaddata\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Searches for and loads the contents of the named fixture into the database.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-loaddata-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database into which the data will be loaded. Defaults to\n<code class=\"docutils literal notranslate\">default</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-ignorenonexistent\">\n<span id=\"cmdoption-loaddata-i\"></span><span class=\"sig-name descname\">--ignorenonexistent</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-i</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-loaddata-ignorenonexistent\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Ignores fields and models that may have been removed since the fixture was\noriginally generated.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-app\">\n<span class=\"sig-name descname\">--app</span><span class=\"sig-prename descclassname\"> APP_LABEL</span><a class=\"heading-anchor\" href=\"#cmdoption-loaddata-app\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies a single app to look for fixtures in rather than looking in all apps.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-format\">\n<span class=\"sig-name descname\">--format</span><span class=\"sig-prename descclassname\"> FORMAT</span><a class=\"heading-anchor\" href=\"#cmdoption-loaddata-format\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<aside class=\"version-note version-added\" data-version=\"2.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.0</p></aside>\n<p>Specifies the <a class=\"reference internal\" href=\"/pl/2.1/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">serialization format</span></a> (e.g.,\n<code class=\"docutils literal notranslate\">json</code> or <code class=\"docutils literal notranslate\">xml</code>) for fixtures <a class=\"reference internal\" href=\"#loading-fixtures-stdin\"><span class=\"std std-ref\">read from stdin</span></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-exclude\">\n<span id=\"cmdoption-loaddata-e\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-e</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><a class=\"heading-anchor\" href=\"#cmdoption-loaddata-exclude\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Excludes loading the fixtures from the given applications and/or models (in the\nform of <code class=\"docutils literal notranslate\">app_label</code> or <code class=\"docutils literal notranslate\">app_label.ModelName</code>). Use the option multiple\ntimes to exclude more than one app or model.</p>\n<section id=\"what-s-a-fixture\">\n<h4>What’s a „fixture”?<a class=\"heading-anchor\" href=\"#what-s-a-fixture\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>A <em>fixture</em> is a collection of files that contain the serialized contents of\nthe database. Each fixture has a unique name, and the files that comprise the\nfixture can be distributed over multiple directories, in multiple applications.</p>\n<p>Django will search in three locations for fixtures:</p>\n<ol class=\"arabic simple\">\n<li><p>In the <code class=\"docutils literal notranslate\">fixtures</code> directory of every installed application</p></li>\n<li><p>In any directory named in the <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-FIXTURE_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">FIXTURE_DIRS</code></a> setting</p></li>\n<li><p>In the literal path named by the fixture</p></li>\n</ol>\n<p>Django will load any and all fixtures it finds in these locations that match\nthe provided fixture names.</p>\n<p>If the named fixture has a file extension, only fixtures of that type\nwill be loaded. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin loaddata mydata<span class=\"o\">.</span>json\n</code></pre></div>\n<p>would only load JSON fixtures called <code class=\"docutils literal notranslate\">mydata</code>. The fixture extension\nmust correspond to the registered name of a\n<a class=\"reference internal\" href=\"/pl/2.1/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">serializer</span></a> (e.g., <code class=\"docutils literal notranslate\">json</code> or <code class=\"docutils literal notranslate\">xml</code>).</p>\n<p>If you omit the extensions, Django will search all available fixture types\nfor a matching fixture. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin loaddata mydata\n</code></pre></div>\n<p>would look for any fixture of any fixture type called <code class=\"docutils literal notranslate\">mydata</code>. If a fixture\ndirectory contained <code class=\"docutils literal notranslate\">mydata.json</code>, that fixture would be loaded\nas a JSON fixture.</p>\n<p>The fixtures that are named can include directory components. These\ndirectories will be included in the search path. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin loaddata foo<span class=\"o\">/</span>bar<span class=\"o\">/</span>mydata<span class=\"o\">.</span>json\n</code></pre></div>\n<p>would search <code class=\"docutils literal notranslate\">&lt;app_label&gt;/fixtures/foo/bar/mydata.json</code> for each installed\napplication,  <code class=\"docutils literal notranslate\">&lt;dirname&gt;/foo/bar/mydata.json</code> for each directory in\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-FIXTURE_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\">FIXTURE_DIRS</code></a>, and the literal path <code class=\"docutils literal notranslate\">foo/bar/mydata.json</code>.</p>\n<p>When fixture files are processed, the data is saved to the database as is.\nModel defined <a class=\"reference internal\" href=\"/pl/2.1/ref/models/instances/#django.db.models.Model.save\" title=\"django.db.models.Model.save\"><code class=\"xref py py-meth docutils literal notranslate\">save()</code></a> methods are not called, and\nany <a class=\"reference internal\" href=\"/pl/2.1/ref/signals/#django.db.models.signals.pre_save\" title=\"django.db.models.signals.pre_save\"><code class=\"xref py py-data docutils literal notranslate\">pre_save</code></a> or\n<a class=\"reference internal\" href=\"/pl/2.1/ref/signals/#django.db.models.signals.post_save\" title=\"django.db.models.signals.post_save\"><code class=\"xref py py-data docutils literal notranslate\">post_save</code></a> signals will be called with\n<code class=\"docutils literal notranslate\">raw=True</code> since the instance only contains attributes that are local to the\nmodel. You may, for example, want to disable handlers that access\nrelated fields that aren’t present during fixture loading and would otherwise\nraise an exception:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.db.models.signals</span> <span class=\"kn\">import</span> post_save\n<span class=\"kn\">from</span> <span class=\"nn\">.models</span> <span class=\"kn\">import</span> MyModel\n\n<span class=\"k\">def</span> <span class=\"nf\">my_handler</span><span class=\"p\">(</span><span class=\"o\">**</span>kwargs<span class=\"p\">):</span>\n    <span class=\"c1\"># disable the handler during fixture loading</span>\n    <span class=\"k\">if</span> kwargs<span class=\"p\">[</span><span class=\"s1\">&#39;raw&#39;</span><span class=\"p\">]:</span>\n        <span class=\"k\">return</span>\n    <span class=\"o\">...</span>\n\npost_save<span class=\"o\">.</span>connect<span class=\"p\">(</span>my_handler<span class=\"p\">,</span> sender<span class=\"o\">=</span>MyModel<span class=\"p\">)</span>\n</code></pre></div>\n<p>You could also write a simple decorator to encapsulate this logic:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">functools</span> <span class=\"kn\">import</span> wraps\n\n<span class=\"k\">def</span> <span class=\"nf\">disable_for_loaddata</span><span class=\"p\">(</span>signal_handler<span class=\"p\">):</span>\n    <span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    Decorator that turns off signal handlers when loading fixture data.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"nd\">@wraps</span><span class=\"p\">(</span>signal_handler<span class=\"p\">)</span>\n    <span class=\"k\">def</span> <span class=\"nf\">wrapper</span><span class=\"p\">(</span><span class=\"o\">*</span>args<span class=\"p\">,</span> <span class=\"o\">**</span>kwargs<span class=\"p\">):</span>\n        <span class=\"k\">if</span> kwargs<span class=\"p\">[</span><span class=\"s1\">&#39;raw&#39;</span><span class=\"p\">]:</span>\n            <span class=\"k\">return</span>\n        signal_handler<span class=\"p\">(</span><span class=\"o\">*</span>args<span class=\"p\">,</span> <span class=\"o\">**</span>kwargs<span class=\"p\">)</span>\n    <span class=\"k\">return</span> wrapper\n\n<span class=\"nd\">@disable_for_loaddata</span>\n<span class=\"k\">def</span> <span class=\"nf\">my_handler</span><span class=\"p\">(</span><span class=\"o\">**</span>kwargs<span class=\"p\">):</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>Just be aware that this logic will disable the signals whenever fixtures are\ndeserialized, not just during <code class=\"docutils literal notranslate\">loaddata</code>.</p>\n<p>Note that the order in which fixture files are processed is undefined. However,\nall fixture data is installed as a single transaction, so data in\none fixture can reference data in another fixture. If the database backend\nsupports row-level constraints, these constraints will be checked at the\nend of the transaction.</p>\n<p>The <a class=\"reference internal\" href=\"#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\">dumpdata</code></a> command can be used to generate input for <code class=\"docutils literal notranslate\">loaddata</code>.</p>\n</section>\n<section id=\"compressed-fixtures\">\n<h4>Compressed fixtures<a class=\"heading-anchor\" href=\"#compressed-fixtures\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Fixtures may be compressed in <code class=\"docutils literal notranslate\">zip</code>, <code class=\"docutils literal notranslate\">gz</code>, or <code class=\"docutils literal notranslate\">bz2</code> format. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin loaddata mydata<span class=\"o\">.</span>json\n</code></pre></div>\n<p>would look for any of <code class=\"docutils literal notranslate\">mydata.json</code>, <code class=\"docutils literal notranslate\">mydata.json.zip</code>,\n<code class=\"docutils literal notranslate\">mydata.json.gz</code>, or <code class=\"docutils literal notranslate\">mydata.json.bz2</code>. The first file contained within a\nzip-compressed archive is used.</p>\n<p>Note that if two fixtures with the same name but different\nfixture type are discovered (for example, if <code class=\"docutils literal notranslate\">mydata.json</code> and\n<code class=\"docutils literal notranslate\">mydata.xml.gz</code> were found in the same fixture directory), fixture\ninstallation will be aborted, and any data installed in the call to\n<code class=\"docutils literal notranslate\">loaddata</code> will be removed from the database.</p>\n<aside class=\"admonition-mysql-with-myisam-and-fixtures admonition\" role=\"note\">\n<p class=\"admonition-title\">MySQL with MyISAM and fixtures</p>\n<p>The MyISAM storage engine of MySQL doesn’t support transactions or\nconstraints, so if you use MyISAM, you won’t get validation of fixture\ndata, or a rollback if multiple transaction files are found.</p>\n</aside>\n</section>\n<section id=\"database-specific-fixtures\">\n<h4>Database-specific fixtures<a class=\"heading-anchor\" href=\"#database-specific-fixtures\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>If you’re in a multi-database setup, you might have fixture data that\nyou want to load onto one database, but not onto another. In this\nsituation, you can add a database identifier into the names of your fixtures.</p>\n<p>For example, if your <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a> setting has a «master» database\ndefined, name the fixture <code class=\"docutils literal notranslate\">mydata.master.json</code> or\n<code class=\"docutils literal notranslate\">mydata.master.json.gz</code> and the fixture will only be loaded when you\nspecify you want to load data into the <code class=\"docutils literal notranslate\">master</code> database.</p>\n</section>\n<section id=\"loading-fixtures-from-stdin\">\n<span id=\"loading-fixtures-stdin\"></span><h4>Loading fixtures from <code class=\"docutils literal notranslate\">stdin</code><a class=\"heading-anchor\" href=\"#loading-fixtures-from-stdin\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<aside class=\"version-note version-added\" data-version=\"2.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.0</p></aside>\n<p>You can use a dash as the fixture name to load input from <code class=\"docutils literal notranslate\">sys.stdin</code>. For\nexample:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin loaddata <span class=\"o\">--</span><span class=\"nb\">format</span><span class=\"o\">=</span>json <span class=\"o\">-</span>\n</code></pre></div>\n<p>When reading from <code class=\"docutils literal notranslate\">stdin</code>, the <a class=\"reference internal\" href=\"#cmdoption-loaddata-format\"><code class=\"xref std std-option docutils literal notranslate\">--format</code></a> option\nis required to specify the <a class=\"reference internal\" href=\"/pl/2.1/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">serialization format</span></a>\nof the input (e.g., <code class=\"docutils literal notranslate\">json</code> or <code class=\"docutils literal notranslate\">xml</code>).</p>\n<p>Loading from <code class=\"docutils literal notranslate\">stdin</code> is useful with standard input and output redirections.\nFor example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin dumpdata <span class=\"o\">--</span><span class=\"nb\">format</span><span class=\"o\">=</span>json <span class=\"o\">--</span>database<span class=\"o\">=</span>test app_label<span class=\"o\">.</span>ModelName <span class=\"o\">|</span> django<span class=\"o\">-</span>admin loaddata <span class=\"o\">--</span><span class=\"nb\">format</span><span class=\"o\">=</span>json <span class=\"o\">--</span>database<span class=\"o\">=</span>prod <span class=\"o\">-</span>\n</code></pre></div>\n</section>\n</section>\n<section id=\"makemessages\">\n<h3><code class=\"docutils literal notranslate\">makemessages</code><a class=\"heading-anchor\" href=\"#makemessages\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-makemessages\">\n<span class=\"sig-name descname\">django-admin makemessages</span><a class=\"heading-anchor\" href=\"#django-admin-makemessages\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs over the entire source tree of the current directory and pulls out all\nstrings marked for translation. It creates (or updates) a message file in the\nconf/locale (in the Django tree) or locale (for project and application)\ndirectory. After making changes to the messages files you need to compile them\nwith <a class=\"reference internal\" href=\"#django-admin-compilemessages\"><code class=\"xref std std-djadmin docutils literal notranslate\">compilemessages</code></a> for use with the builtin gettext support. See\nthe <a class=\"reference internal\" href=\"/pl/2.1/topics/i18n/translation/#how-to-create-language-files\"><span class=\"std std-ref\">i18n documentation</span></a> for details.</p>\n<p>This command doesn’t require configured settings. However, when settings aren’t\nconfigured, the command can’t ignore the <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-MEDIA_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_ROOT</code></a> and\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-STATIC_ROOT\"><code class=\"xref std std-setting docutils literal notranslate\">STATIC_ROOT</code></a> directories or include <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-LOCALE_PATHS\"><code class=\"xref std std-setting docutils literal notranslate\">LOCALE_PATHS</code></a>. It will\nalso write files in UTF-8 rather than in <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-FILE_CHARSET\"><code class=\"xref std std-setting docutils literal notranslate\">FILE_CHARSET</code></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-all\">\n<span id=\"cmdoption-makemessages-a\"></span><span class=\"sig-name descname\">--all</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-a</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-all\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Updates the message files for all available languages.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-extension\">\n<span id=\"cmdoption-makemessages-e\"></span><span class=\"sig-name descname\">--extension</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-e</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-extension\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies a list of file extensions to examine (default: <code class=\"docutils literal notranslate\">html</code>, <code class=\"docutils literal notranslate\">txt</code>,\n<code class=\"docutils literal notranslate\">py</code> or <code class=\"docutils literal notranslate\">js</code> if <a class=\"reference internal\" href=\"#cmdoption-makemessages-domain\"><code class=\"xref std std-option docutils literal notranslate\">--domain</code></a> is <code class=\"docutils literal notranslate\">js</code>).</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>de <span class=\"o\">--</span>extension xhtml\n</code></pre></div>\n<p>Separate multiple extensions with commas or use <code class=\"docutils literal notranslate\">-e</code> or <code class=\"docutils literal notranslate\">--extension</code>\nmultiple times:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>de <span class=\"o\">--</span>extension<span class=\"o\">=</span>html<span class=\"p\">,</span>txt <span class=\"o\">--</span>extension xml\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-locale\">\n<span id=\"cmdoption-makemessages-l\"></span><span class=\"sig-name descname\">--locale</span><span class=\"sig-prename descclassname\"> LOCALE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-l</span><span class=\"sig-prename descclassname\"> LOCALE</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-locale\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the locale(s) to process.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-exclude\">\n<span id=\"cmdoption-makemessages-x\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-x</span><span class=\"sig-prename descclassname\"> EXCLUDE</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-exclude\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the locale(s) to exclude from processing. If not provided, no locales\nare excluded.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>pt_BR\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>pt_BR <span class=\"o\">--</span>locale<span class=\"o\">=</span>fr\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">-</span>l pt_BR\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">-</span>l pt_BR <span class=\"o\">-</span>l fr\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>exclude<span class=\"o\">=</span>pt_BR\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>exclude<span class=\"o\">=</span>pt_BR <span class=\"o\">--</span>exclude<span class=\"o\">=</span>fr\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">-</span>x pt_BR\ndjango<span class=\"o\">-</span>admin makemessages <span class=\"o\">-</span>x pt_BR <span class=\"o\">-</span>x fr\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-domain\">\n<span id=\"cmdoption-makemessages-d\"></span><span class=\"sig-name descname\">--domain</span><span class=\"sig-prename descclassname\"> DOMAIN</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-d</span><span class=\"sig-prename descclassname\"> DOMAIN</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-domain\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the domain of the messages files. Supported options are:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">django</code> for all <code class=\"docutils literal notranslate\">*.py</code>, <code class=\"docutils literal notranslate\">*.html</code> and <code class=\"docutils literal notranslate\">*.txt</code> files (default)</p></li>\n<li><p><code class=\"docutils literal notranslate\">djangojs</code> for <code class=\"docutils literal notranslate\">*.js</code> files</p></li>\n</ul>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-symlinks\">\n<span id=\"cmdoption-makemessages-s\"></span><span class=\"sig-name descname\">--symlinks</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-s</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-symlinks\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Follows symlinks to directories when looking for new translation strings.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>de <span class=\"o\">--</span>symlinks\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-ignore\">\n<span id=\"cmdoption-makemessages-i\"></span><span class=\"sig-name descname\">--ignore</span><span class=\"sig-prename descclassname\"> PATTERN</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-i</span><span class=\"sig-prename descclassname\"> PATTERN</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-ignore\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Ignores files or directories matching the given <a class=\"reference external\" href=\"https://docs.python.org/3/library/glob.html#module-glob\" title=\"(w Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">glob</code></a>-style pattern. Use\nmultiple times to ignore more.</p>\n<p>These patterns are used by default: <code class=\"docutils literal notranslate\">'CVS'</code>, <code class=\"docutils literal notranslate\">'.*'</code>, <code class=\"docutils literal notranslate\">'*~'</code>, <code class=\"docutils literal notranslate\">'*.pyc'</code>.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin makemessages <span class=\"o\">--</span>locale<span class=\"o\">=</span>en_US <span class=\"o\">--</span>ignore<span class=\"o\">=</span>apps<span class=\"o\">/*</span> <span class=\"o\">--</span>ignore<span class=\"o\">=</span>secret<span class=\"o\">/*.</span>html\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-no-default-ignore\">\n<span class=\"sig-name descname\">--no-default-ignore</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-no-default-ignore\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables the default values of <code class=\"docutils literal notranslate\">--ignore</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-no-wrap\">\n<span class=\"sig-name descname\">--no-wrap</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-no-wrap\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables breaking long message lines into several lines in language files.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-no-location\">\n<span class=\"sig-name descname\">--no-location</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-no-location\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses writing «<code class=\"docutils literal notranslate\">#: filename:line</code>’ comment lines in language files.\nUsing this option makes it harder for technically skilled translators to\nunderstand each message’s context.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-add-location\">\n<span class=\"sig-name descname\">--add-location</span><span class=\"sig-prename descclassname\"> [{full,file,never}]</span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-add-location\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<aside class=\"version-note version-added\" data-version=\"2.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.0</p></aside>\n<p>Controls <code class=\"docutils literal notranslate\">#: filename:line</code> comment lines in language files. If the option\nis:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">full</code> (the default if not given): the lines include both file name and\nline number.</p></li>\n<li><p><code class=\"docutils literal notranslate\">file</code>: the line number is omitted.</p></li>\n<li><p><code class=\"docutils literal notranslate\">never</code>: the lines are suppressed (same as <a class=\"reference internal\" href=\"#cmdoption-makemessages-no-location\"><code class=\"xref std std-option docutils literal notranslate\">--no-location</code></a>).</p></li>\n</ul>\n<p>Requires <code class=\"docutils literal notranslate\">gettext</code> 0.19 or newer.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-keep-pot\">\n<span class=\"sig-name descname\">--keep-pot</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-keep-pot\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prevents deleting the temporary <code class=\"docutils literal notranslate\">.pot</code> files generated before creating the\n<code class=\"docutils literal notranslate\">.po</code> file. This is useful for debugging errors which may prevent the final\nlanguage files from being created.</p>\n<aside class=\"admonition admonition-seealso\" role=\"note\">\n<p class=\"admonition-title\">Zobacz także</p>\n<p>See <a class=\"reference internal\" href=\"/pl/2.1/topics/i18n/translation/#customizing-makemessages\"><span class=\"std std-ref\">Customizing the makemessages command</span></a> for instructions on how to customize\nthe keywords that <a class=\"reference internal\" href=\"#django-admin-makemessages\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemessages</code></a> passes to <code class=\"docutils literal notranslate\">xgettext</code>.</p>\n</aside>\n</section>\n<section id=\"makemigrations\">\n<h3><code class=\"docutils literal notranslate\">makemigrations</code><a class=\"heading-anchor\" href=\"#makemigrations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-makemigrations\">\n<span class=\"sig-name descname\">django-admin makemigrations [app_label [app_label ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-makemigrations\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates new migrations based on the changes detected to your models.\nMigrations, their relationship with apps and more are covered in depth in\n<a class=\"reference internal\" href=\"/pl/2.1/topics/migrations/\"><span class=\"doc\">the migrations documentation</span></a>.</p>\n<p>Providing one or more app names as arguments will limit the migrations created\nto the app(s) specified and any dependencies needed (the table at the other end\nof a <code class=\"docutils literal notranslate\">ForeignKey</code>, for example).</p>\n<p>To add migrations to an app that doesn’t have a <code class=\"docutils literal notranslate\">migrations</code> directory, run\n<code class=\"docutils literal notranslate\">makemigrations</code> with the app’s <code class=\"docutils literal notranslate\">app_label</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-noinput\">\n<span id=\"cmdoption-makemigrations-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts. If a suppressed prompt cannot be resolved\nautomatically, the command will exit with error code 3.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-empty\">\n<span class=\"sig-name descname\">--empty</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-empty\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Outputs an empty migration for the specified apps, for manual editing. This is\nfor advanced users and should not be used unless you are familiar with the\nmigration format, migration operations, and the dependencies between your\nmigrations.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-dry-run\">\n<span class=\"sig-name descname\">--dry-run</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-dry-run\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Shows what migrations would be made without actually writing any migrations\nfiles to disk. Using this option along with <code class=\"docutils literal notranslate\">--verbosity 3</code> will also show\nthe complete migrations files that would be written.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-merge\">\n<span class=\"sig-name descname\">--merge</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-merge\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Enables fixing of migration conflicts.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-name\">\n<span id=\"cmdoption-makemigrations-n\"></span><span class=\"sig-name descname\">--name</span><span class=\"sig-prename descclassname\"> NAME</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-n</span><span class=\"sig-prename descclassname\"> NAME</span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-name\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Allows naming the generated migration(s) instead of using a generated name.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-check\">\n<span class=\"sig-name descname\">--check</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-check\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Makes <code class=\"docutils literal notranslate\">makemigrations</code> exit with a non-zero status when model changes without\nmigrations are detected.</p>\n</section>\n<section id=\"migrate\">\n<h3><code class=\"docutils literal notranslate\">migrate</code><a class=\"heading-anchor\" href=\"#migrate\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-migrate\">\n<span class=\"sig-name descname\">django-admin migrate [app_label] [migration_name]</span><a class=\"heading-anchor\" href=\"#django-admin-migrate\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Synchronizes the database state with the current set of models and migrations.\nMigrations, their relationship with apps and more are covered in depth in\n<a class=\"reference internal\" href=\"/pl/2.1/topics/migrations/\"><span class=\"doc\">the migrations documentation</span></a>.</p>\n<p>The behavior of this command changes depending on the arguments provided:</p>\n<ul class=\"simple\">\n<li><p>No arguments: All apps have all of their migrations run.</p></li>\n<li><p><code class=\"docutils literal notranslate\">&lt;app_label&gt;</code>: The specified app has its migrations run, up to the most\nrecent migration. This may involve running other apps» migrations too, due\nto dependencies.</p></li>\n<li><p><code class=\"docutils literal notranslate\">&lt;app_label&gt; &lt;migrationname&gt;</code>: Brings the database schema to a state where\nthe named migration is applied, but no later migrations in the same app are\napplied. This may involve unapplying migrations if you have previously\nmigrated past the named migration. Use the name <code class=\"docutils literal notranslate\">zero</code> to unapply all\nmigrations for an app.</p></li>\n</ul>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to migrate. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-fake\">\n<span class=\"sig-name descname\">--fake</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-fake\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Marks the migrations up to the target one (following the rules above) as\napplied, but without actually running the SQL to change your database schema.</p>\n<p>This is intended for advanced users to manipulate the\ncurrent migration state directly if they’re manually applying changes;\nbe warned that using <code class=\"docutils literal notranslate\">--fake</code> runs the risk of putting the migration state\ntable into a state where manual recovery will be needed to make migrations\nrun correctly.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-fake-initial\">\n<span class=\"sig-name descname\">--fake-initial</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-fake-initial\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Allows Django to skip an app’s initial migration if all database tables with\nthe names of all models created by all\n<a class=\"reference internal\" href=\"/pl/2.1/ref/migration-operations/#django.db.migrations.operations.CreateModel\" title=\"django.db.migrations.operations.CreateModel\"><code class=\"xref py py-class docutils literal notranslate\">CreateModel</code></a> operations in that\nmigration already exist. This option is intended for use when first running\nmigrations against a database that preexisted the use of migrations. This\noption does not, however, check for matching database schema beyond matching\ntable names and so is only safe to use if you are confident that your existing\nschema matches what is recorded in your initial migration.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-run-syncdb\">\n<span class=\"sig-name descname\">--run-syncdb</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-run-syncdb\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Allows creating tables for apps without migrations. While this isn’t\nrecommended, the migrations framework is sometimes too slow on large projects\nwith hundreds of models.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-noinput\">\n<span id=\"cmdoption-migrate-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts. An example prompt is asking about removing stale\ncontent types.</p>\n</section>\n<section id=\"runserver\">\n<h3><code class=\"docutils literal notranslate\">runserver</code><a class=\"heading-anchor\" href=\"#runserver\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-runserver\">\n<span class=\"sig-name descname\">django-admin runserver [addrport]</span><a class=\"heading-anchor\" href=\"#django-admin-runserver\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Starts a lightweight development Web server on the local machine. By default,\nthe server runs on port 8000 on the IP address <code class=\"docutils literal notranslate\">127.0.0.1</code>. You can pass in an\nIP address and port number explicitly.</p>\n<p>If you run this script as a user with normal privileges (recommended), you\nmight not have access to start a port on a low port number. Low port numbers\nare reserved for the superuser (root).</p>\n<p>This server uses the WSGI application object specified by the\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-WSGI_APPLICATION\"><code class=\"xref std std-setting docutils literal notranslate\">WSGI_APPLICATION</code></a> setting.</p>\n<p>DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through\nsecurity audits or performance tests. (And that’s how it’s gonna stay. We’re in\nthe business of making Web frameworks, not Web servers, so improving this\nserver to be able to handle a production environment is outside the scope of\nDjango.)</p>\n<p>The development server automatically reloads Python code for each request, as\nneeded. You don’t need to restart the server for code changes to take effect.\nHowever, some actions like adding files don’t trigger a restart, so you’ll\nhave to restart the server in these cases.</p>\n<p>If you are using Linux and install <a class=\"reference external\" href=\"https://pypi.org/project/pyinotify/\">pyinotify</a>, kernel signals will be used to\nautoreload the server (rather than polling file modification timestamps each\nsecond). This offers better scaling to large projects, reduction in response\ntime to code modification, more robust change detection, and battery usage\nreduction.</p>\n<p>When you start the server, and each time you change Python code while the\nserver is running, the system check framework will check your entire Django\nproject for some common errors (see the <a class=\"reference internal\" href=\"#django-admin-check\"><code class=\"xref std std-djadmin docutils literal notranslate\">check</code></a> command). If any\nerrors are found, they will be printed to standard output.</p>\n<p>You can run as many concurrent servers as you want, as long as they’re on\nseparate ports. Just execute <code class=\"docutils literal notranslate\">django-admin runserver</code> more than once.</p>\n<p>Note that the default IP address, <code class=\"docutils literal notranslate\">127.0.0.1</code>, is not accessible from other\nmachines on your network. To make your development server viewable to other\nmachines on the network, use its own IP address (e.g. <code class=\"docutils literal notranslate\">192.168.2.1</code>) or\n<code class=\"docutils literal notranslate\">0.0.0.0</code> or <code class=\"docutils literal notranslate\">::</code> (with IPv6 enabled).</p>\n<p>You can provide an IPv6 address surrounded by brackets\n(e.g. <code class=\"docutils literal notranslate\">[200a::1]:8000</code>). This will automatically enable IPv6 support.</p>\n<p>A hostname containing ASCII-only characters can also be used.</p>\n<p>If the <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> contrib app is enabled\n(default in new projects) the <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a> command will be overridden\nwith its own <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/#staticfiles-runserver\"><span class=\"std std-ref\">runserver</span></a> command.</p>\n<p>Logging of each request and response of the server is sent to the\n<a class=\"reference internal\" href=\"/pl/2.1/topics/logging/#django-server-logger\"><span class=\"std std-ref\">django.server</span></a> logger.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runserver-noreload\">\n<span class=\"sig-name descname\">--noreload</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runserver-noreload\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables the auto-reloader. This means any Python code changes you make while\nthe server is running will <em>not</em> take effect if the particular Python modules\nhave already been loaded into memory.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runserver-nothreading\">\n<span class=\"sig-name descname\">--nothreading</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runserver-nothreading\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables use of threading in the development server. The server is\nmultithreaded by default.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runserver-ipv6\">\n<span id=\"cmdoption-runserver-6\"></span><span class=\"sig-name descname\">--ipv6</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-6</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runserver-ipv6\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Uses IPv6 for the development server. This changes the default IP address from\n<code class=\"docutils literal notranslate\">127.0.0.1</code> to <code class=\"docutils literal notranslate\">::1</code>.</p>\n<section id=\"examples-of-using-different-ports-and-addresses\">\n<h4>Examples of using different ports and addresses<a class=\"heading-anchor\" href=\"#examples-of-using-different-ports-and-addresses\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Port 8000 on IP address <code class=\"docutils literal notranslate\">127.0.0.1</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver\n</code></pre></div>\n<p>Port 8000 on IP address <code class=\"docutils literal notranslate\">1.2.3.4</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n<p>Port 7000 on IP address <code class=\"docutils literal notranslate\">127.0.0.1</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 7000 on IP address <code class=\"docutils literal notranslate\">1.2.3.4</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 8000 on IPv6 address <code class=\"docutils literal notranslate\">::1</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"o\">-</span><span class=\"mi\">6</span>\n</code></pre></div>\n<p>Port 7000 on IPv6 address <code class=\"docutils literal notranslate\">::1</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"o\">-</span><span class=\"mi\">6</span> <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 7000 on IPv6 address <code class=\"docutils literal notranslate\">2001:0db8:1234:5678::9</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"p\">[</span><span class=\"mi\">2001</span><span class=\"p\">:</span><span class=\"mi\">0</span>db8<span class=\"p\">:</span><span class=\"mi\">1234</span><span class=\"p\">:</span><span class=\"mi\">5678</span><span class=\"p\">::</span><span class=\"mi\">9</span><span class=\"p\">]:</span><span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 8000 on IPv4 address of host <code class=\"docutils literal notranslate\">localhost</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver localhost<span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n<p>Port 8000 on IPv6 address of host <code class=\"docutils literal notranslate\">localhost</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"o\">-</span><span class=\"mi\">6</span> localhost<span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n</section>\n<section id=\"serving-static-files-with-the-development-server\">\n<h4>Serving static files with the development server<a class=\"heading-anchor\" href=\"#serving-static-files-with-the-development-server\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>By default, the development server doesn’t serve any static files for your site\n(such as CSS files, images, things under <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\">MEDIA_URL</code></a> and so forth). If\nyou want to configure Django to serve static media, read\n<a class=\"reference internal\" href=\"/pl/2.1/howto/static-files/\"><span class=\"doc\">Managing static files (e.g. images, JavaScript, CSS)</span></a>.</p>\n</section>\n</section>\n<section id=\"sendtestemail\">\n<h3><code class=\"docutils literal notranslate\">sendtestemail</code><a class=\"heading-anchor\" href=\"#sendtestemail\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-sendtestemail\">\n<span class=\"sig-name descname\">django-admin sendtestemail [email [email ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-sendtestemail\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Sends a test email (to confirm email sending through Django is working) to the\nrecipient(s) specified. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin sendtestemail foo<span class=\"nd\">@example</span><span class=\"o\">.</span>com bar<span class=\"nd\">@example</span><span class=\"o\">.</span>com\n</code></pre></div>\n<p>There are a couple of options, and you may use any combination of them\ntogether:</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sendtestemail-managers\">\n<span class=\"sig-name descname\">--managers</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-sendtestemail-managers\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Mails the email addresses specified in <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a> using\n<a class=\"reference internal\" href=\"/pl/2.1/topics/email/#django.core.mail.mail_managers\" title=\"django.core.mail.mail_managers\"><code class=\"xref py py-meth docutils literal notranslate\">mail_managers()</code></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sendtestemail-admins\">\n<span class=\"sig-name descname\">--admins</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-sendtestemail-admins\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Mails the email addresses specified in <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> using\n<a class=\"reference internal\" href=\"/pl/2.1/topics/email/#django.core.mail.mail_admins\" title=\"django.core.mail.mail_admins\"><code class=\"xref py py-meth docutils literal notranslate\">mail_admins()</code></a>.</p>\n</section>\n<section id=\"shell\">\n<h3><code class=\"docutils literal notranslate\">shell</code><a class=\"heading-anchor\" href=\"#shell\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-shell\">\n<span class=\"sig-name descname\">django-admin shell</span><a class=\"heading-anchor\" href=\"#django-admin-shell\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Starts the Python interactive interpreter.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-shell-interface\">\n<span id=\"cmdoption-shell-i\"></span><span class=\"sig-name descname\">--interface</span><span class=\"sig-prename descclassname\"> {ipython,bpython,python}</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-i</span><span class=\"sig-prename descclassname\"> {ipython,bpython,python}</span><a class=\"heading-anchor\" href=\"#cmdoption-shell-interface\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the shell to use. By default, Django will use <a class=\"reference external\" href=\"https://ipython.org/\">IPython</a> or <a class=\"reference external\" href=\"https://bpython-interpreter.org/\">bpython</a> if\neither is installed. If both are installed, specify which one you want like so:</p>\n<p>IPython:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin shell <span class=\"o\">-</span>i ipython\n</code></pre></div>\n<p>bpython:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin shell <span class=\"o\">-</span>i bpython\n</code></pre></div>\n<p>If you have a „rich” shell installed but want to force use of the „plain”\nPython interpreter, use <code class=\"docutils literal notranslate\">python</code> as the interface name, like so:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin shell <span class=\"o\">-</span>i python\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-shell-nostartup\">\n<span class=\"sig-name descname\">--nostartup</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-shell-nostartup\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables reading the startup script for the „plain” Python interpreter. By\ndefault, the script pointed to by the <span class=\"target\" id=\"index-3\"></span><a class=\"reference external\" href=\"https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP\" title=\"(w Python v3.14)\"><code class=\"xref std std-envvar docutils literal notranslate\">PYTHONSTARTUP</code></a> environment\nvariable or the <code class=\"docutils literal notranslate\">~/.pythonrc.py</code> script is read.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-shell-command\">\n<span id=\"cmdoption-shell-c\"></span><span class=\"sig-name descname\">--command</span><span class=\"sig-prename descclassname\"> COMMAND</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-c</span><span class=\"sig-prename descclassname\"> COMMAND</span><a class=\"heading-anchor\" href=\"#cmdoption-shell-command\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Lets you pass a command as a string to execute it as Django, like so:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin shell <span class=\"o\">--</span>command<span class=\"o\">=</span><span class=\"s2\">&quot;import django; print(django.__version__)&quot;</span>\n</code></pre></div>\n<p>You can also pass code in on standard input to execute it. For example:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>django-admin shell &lt;&lt;EOF\n<span class=\"go\">&gt; import django</span>\n<span class=\"go\">&gt; print(django.__version__)</span>\n<span class=\"go\">&gt; EOF</span>\n</code></pre></div>\n<p>On Windows, the REPL is output due to implementation limits of\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/select.html#select.select\" title=\"(w Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">select.select()</code></a> on that platform.</p>\n</section>\n<section id=\"showmigrations\">\n<h3><code class=\"docutils literal notranslate\">showmigrations</code><a class=\"heading-anchor\" href=\"#showmigrations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-showmigrations\">\n<span class=\"sig-name descname\">django-admin showmigrations [app_label [app_label ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-showmigrations\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Shows all migrations in a project. You can choose from one of two formats:</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-showmigrations-list\">\n<span id=\"cmdoption-showmigrations-l\"></span><span class=\"sig-name descname\">--list</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-l</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-showmigrations-list\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Lists all of the apps Django knows about, the migrations available for each\napp, and whether or not each migration is applied (marked by an <code class=\"docutils literal notranslate\">[X]</code> next to\nthe migration name).</p>\n<p>Apps without migrations are also listed, but have <code class=\"docutils literal notranslate\">(no migrations)</code> printed\nunder them.</p>\n<p>This is the default output format.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-showmigrations-plan\">\n<span id=\"cmdoption-showmigrations-p\"></span><span class=\"sig-name descname\">--plan</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-p</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-showmigrations-plan\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Shows the migration plan Django will follow to apply migrations. Like\n<code class=\"docutils literal notranslate\">--list</code>, applied migrations are marked by an <code class=\"docutils literal notranslate\">[X]</code>. For a <code class=\"docutils literal notranslate\">--verbosity</code>\nof 2 and above, all dependencies of a migration will also be shown.</p>\n<p><code class=\"docutils literal notranslate\">app_label</code>s arguments limit the output, however, dependencies of provided\napps may also be included.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-showmigrations-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-showmigrations-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to examine. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"sqlflush\">\n<h3><code class=\"docutils literal notranslate\">sqlflush</code><a class=\"heading-anchor\" href=\"#sqlflush\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-sqlflush\">\n<span class=\"sig-name descname\">django-admin sqlflush</span><a class=\"heading-anchor\" href=\"#django-admin-sqlflush\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prints the SQL statements that would be executed for the <a class=\"reference internal\" href=\"#django-admin-flush\"><code class=\"xref std std-djadmin docutils literal notranslate\">flush</code></a>\ncommand.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sqlflush-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-sqlflush-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database for which to print the SQL. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"sqlmigrate\">\n<h3><code class=\"docutils literal notranslate\">sqlmigrate</code><a class=\"heading-anchor\" href=\"#sqlmigrate\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-sqlmigrate\">\n<span class=\"sig-name descname\">django-admin sqlmigrate app_label migration_name</span><a class=\"heading-anchor\" href=\"#django-admin-sqlmigrate\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prints the SQL for the named migration. This requires an active database\nconnection, which it will use to resolve constraint names; this means you must\ngenerate the SQL against a copy of the database you wish to later apply it on.</p>\n<p>Note that <code class=\"docutils literal notranslate\">sqlmigrate</code> doesn’t colorize its output.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sqlmigrate-backwards\">\n<span class=\"sig-name descname\">--backwards</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-sqlmigrate-backwards\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Generates the SQL for unapplying the migration. By default, the SQL created is\nfor running the migration in the forwards direction.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sqlmigrate-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-sqlmigrate-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database for which to generate the SQL. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"sqlsequencereset\">\n<h3><code class=\"docutils literal notranslate\">sqlsequencereset</code><a class=\"heading-anchor\" href=\"#sqlsequencereset\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-sqlsequencereset\">\n<span class=\"sig-name descname\">django-admin sqlsequencereset app_label [app_label ...]</span><a class=\"heading-anchor\" href=\"#django-admin-sqlsequencereset\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Prints the SQL statements for resetting sequences for the given app name(s).</p>\n<p>Sequences are indexes used by some database engines to track the next available\nnumber for automatically incremented fields.</p>\n<p>Use this command to generate SQL which will fix cases where a sequence is out\nof sync with its automatically incremented field data.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sqlsequencereset-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-sqlsequencereset-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database for which to print the SQL. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n<section id=\"squashmigrations\">\n<h3><code class=\"docutils literal notranslate\">squashmigrations</code><a class=\"heading-anchor\" href=\"#squashmigrations\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-squashmigrations\">\n<span class=\"sig-name descname\">django-admin squashmigrations app_label [start_migration_name] migration_name</span><a class=\"heading-anchor\" href=\"#django-admin-squashmigrations\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Squashes the migrations for <code class=\"docutils literal notranslate\">app_label</code> up to and including <code class=\"docutils literal notranslate\">migration_name</code>\ndown into fewer migrations, if possible. The resulting squashed migrations\ncan live alongside the unsquashed ones safely. For more information,\nplease read <a class=\"reference internal\" href=\"/pl/2.1/topics/migrations/#migration-squashing\"><span class=\"std std-ref\">Squashing migrations</span></a>.</p>\n<p>When <code class=\"docutils literal notranslate\">start_migration_name</code> is given, Django will only include migrations\nstarting from and including this migration. This helps to mitigate the\nsquashing limitation of <a class=\"reference internal\" href=\"/pl/2.1/ref/migration-operations/#django.db.migrations.operations.RunPython\" title=\"django.db.migrations.operations.RunPython\"><code class=\"xref py py-class docutils literal notranslate\">RunPython</code></a> and\n<a class=\"reference internal\" href=\"/pl/2.1/ref/migration-operations/#django.db.migrations.operations.RunSQL\" title=\"django.db.migrations.operations.RunSQL\"><code class=\"xref py py-class docutils literal notranslate\">django.db.migrations.operations.RunSQL</code></a> migration operations.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-squashmigrations-no-optimize\">\n<span class=\"sig-name descname\">--no-optimize</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-squashmigrations-no-optimize\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables the optimizer when generating a squashed migration. By default, Django\nwill try to optimize the operations in your migrations to reduce the size of\nthe resulting file. Use this option if this process is failing or creating\nincorrect migrations, though please also file a Django bug report about the\nbehavior, as optimization is meant to be safe.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-squashmigrations-noinput\">\n<span id=\"cmdoption-squashmigrations-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-squashmigrations-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-squashmigrations-squashed-name\">\n<span class=\"sig-name descname\">--squashed-name</span><span class=\"sig-prename descclassname\"> SQUASHED_NAME</span><a class=\"heading-anchor\" href=\"#cmdoption-squashmigrations-squashed-name\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<aside class=\"version-note version-added\" data-version=\"2.0\" role=\"note\">\n<p class=\"version-note-title\">New in Django 2.0</p></aside>\n<p>Sets the name of the squashed migration. When omitted, the name is based on the\nfirst and last migration, with <code class=\"docutils literal notranslate\">_squashed_</code> in between.</p>\n</section>\n<section id=\"startapp\">\n<h3><code class=\"docutils literal notranslate\">startapp</code><a class=\"heading-anchor\" href=\"#startapp\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-startapp\">\n<span class=\"sig-name descname\">django-admin startapp name [directory]</span><a class=\"heading-anchor\" href=\"#django-admin-startapp\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates a Django app directory structure for the given app name in the current\ndirectory or the given destination.</p>\n<p>By default the directory created contains a <code class=\"docutils literal notranslate\">models.py</code> file and other app\ntemplate files. (See the <a class=\"reference external\" href=\"https://github.com/django/django/tree/master/django/conf/app_template/\">source</a> for more details.) If only the app\nname is given, the app directory will be created in the current working\ndirectory.</p>\n<p>If the optional destination is provided, Django will use that existing\ndirectory rather than creating a new one. You can use «.» to denote the current\nworking directory.</p>\n<p>For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin startapp myapp <span class=\"o\">/</span>Users<span class=\"o\">/</span>jezdez<span class=\"o\">/</span>Code<span class=\"o\">/</span>myapp\n</code></pre></div>\n<dl class=\"django-admin-option\" id=\"custom-app-and-project-templates\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startapp-template\">\n<span class=\"sig-name descname\">--template</span><span class=\"sig-prename descclassname\"> TEMPLATE</span><a class=\"heading-anchor\" href=\"#cmdoption-startapp-template\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Provides the path to a directory with a custom app template file or a path to a\ncompressed file (<code class=\"docutils literal notranslate\">.tar.gz</code>, <code class=\"docutils literal notranslate\">.tar.bz2</code>, <code class=\"docutils literal notranslate\">.tgz</code>, <code class=\"docutils literal notranslate\">.tbz</code>, <code class=\"docutils literal notranslate\">.zip</code>)\ncontaining the app template files.</p>\n<p>For example, this would look for an app template in the given directory when\ncreating the <code class=\"docutils literal notranslate\">myapp</code> app:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin startapp <span class=\"o\">--</span>template<span class=\"o\">=/</span>Users<span class=\"o\">/</span>jezdez<span class=\"o\">/</span>Code<span class=\"o\">/</span>my_app_template myapp\n</code></pre></div>\n<p>Django will also accept URLs (<code class=\"docutils literal notranslate\">http</code>, <code class=\"docutils literal notranslate\">https</code>, <code class=\"docutils literal notranslate\">ftp</code>) to compressed\narchives with the app template files, downloading and extracting them on the\nfly.</p>\n<p>For example, taking advantage of GitHub’s feature to expose repositories as\nzip files, you can use a URL like:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin startapp <span class=\"o\">--</span>template<span class=\"o\">=</span>https<span class=\"p\">:</span><span class=\"o\">//</span>github<span class=\"o\">.</span>com<span class=\"o\">/</span>githubuser<span class=\"o\">/</span>django<span class=\"o\">-</span>app<span class=\"o\">-</span>template<span class=\"o\">/</span>archive<span class=\"o\">/</span>master<span class=\"o\">.</span>zip myapp\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startapp-extension\">\n<span id=\"cmdoption-startapp-e\"></span><span class=\"sig-name descname\">--extension</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-e</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><a class=\"heading-anchor\" href=\"#cmdoption-startapp-extension\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies which file extensions in the app template should be rendered with the\ntemplate engine. Defaults to <code class=\"docutils literal notranslate\">py</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startapp-name\">\n<span id=\"cmdoption-startapp-n\"></span><span class=\"sig-name descname\">--name</span><span class=\"sig-prename descclassname\"> FILES</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-n</span><span class=\"sig-prename descclassname\"> FILES</span><a class=\"heading-anchor\" href=\"#cmdoption-startapp-name\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies which files in the app template (in addition to those matching\n<code class=\"docutils literal notranslate\">--extension</code>) should be rendered with the template engine. Defaults to an\nempty list.</p>\n<p>The <a class=\"reference internal\" href=\"/pl/2.1/ref/templates/api/#django.template.Context\" title=\"django.template.Context\"><code class=\"xref py py-class docutils literal notranslate\">template context</code></a> used for all matching\nfiles is:</p>\n<ul class=\"simple\">\n<li><p>Any option passed to the <code class=\"docutils literal notranslate\">startapp</code> command (among the command’s supported\noptions)</p></li>\n<li><p><code class=\"docutils literal notranslate\">app_name</code> – the app name as passed to the command</p></li>\n<li><p><code class=\"docutils literal notranslate\">app_directory</code> – the full path of the newly created app</p></li>\n<li><p><code class=\"docutils literal notranslate\">camel_case_app_name</code> – the app name in camel case format</p></li>\n<li><p><code class=\"docutils literal notranslate\">docs_version</code> – the version of the documentation: <code class=\"docutils literal notranslate\">'dev'</code> or <code class=\"docutils literal notranslate\">'1.x'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">django_version</code> – the version of Django, e.g.``»2.0.3»``</p></li>\n</ul>\n<aside class=\"admonition admonition-warning\" id=\"render-warning\" role=\"note\">\n<p class=\"admonition-title\">Ostrzeżenie</p>\n<p>When the app template files are rendered with the Django template\nengine (by default all <code class=\"docutils literal notranslate\">*.py</code> files), Django will also replace all\nstray template variables contained. For example, if one of the Python files\ncontains a docstring explaining a particular feature related\nto template rendering, it might result in an incorrect example.</p>\n<p>To work around this problem, you can use the <a class=\"reference internal\" href=\"/pl/2.1/ref/templates/builtins/#std-templatetag-templatetag\"><code class=\"xref std std-ttag docutils literal notranslate\">templatetag</code></a>\ntemplate tag to „escape” the various parts of the template syntax.</p>\n<p>In addition, to allow Python template files that contain Django template\nlanguage syntax while also preventing packaging systems from trying to\nbyte-compile invalid <code class=\"docutils literal notranslate\">*.py</code> files, template files ending with <code class=\"docutils literal notranslate\">.py-tpl</code>\nwill be renamed to <code class=\"docutils literal notranslate\">.py</code>.</p>\n</aside>\n</section>\n<section id=\"startproject\">\n<h3><code class=\"docutils literal notranslate\">startproject</code><a class=\"heading-anchor\" href=\"#startproject\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-startproject\">\n<span class=\"sig-name descname\">django-admin startproject name [directory]</span><a class=\"heading-anchor\" href=\"#django-admin-startproject\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates a Django project directory structure for the given project name in\nthe current directory or the given destination.</p>\n<p>By default, the new directory contains <code class=\"docutils literal notranslate\">manage.py</code> and a project package\n(containing a <code class=\"docutils literal notranslate\">settings.py</code> and other files). See the <a class=\"reference external\" href=\"https://github.com/django/django/tree/master/django/conf/project_template/\">template source</a> for\ndetails.</p>\n<p>If only the project name is given, both the project directory and project\npackage will be named <code class=\"docutils literal notranslate\">&lt;projectname&gt;</code> and the project directory\nwill be created in the current working directory.</p>\n<p>If the optional destination is provided, Django will use that existing\ndirectory as the project directory, and create <code class=\"docutils literal notranslate\">manage.py</code> and the project\npackage within it. Use «.» to denote the current working directory.</p>\n<p>For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin startproject myproject <span class=\"o\">/</span>Users<span class=\"o\">/</span>jezdez<span class=\"o\">/</span>Code<span class=\"o\">/</span>myproject_repo\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startproject-template\">\n<span class=\"sig-name descname\">--template</span><span class=\"sig-prename descclassname\"> TEMPLATE</span><a class=\"heading-anchor\" href=\"#cmdoption-startproject-template\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies a directory, file path, or URL of a custom project template. See the\n<a class=\"reference internal\" href=\"#cmdoption-startapp-template\"><code class=\"xref std std-option docutils literal notranslate\">startapp --template</code></a> documentation for examples and usage.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startproject-extension\">\n<span id=\"cmdoption-startproject-e\"></span><span class=\"sig-name descname\">--extension</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-e</span><span class=\"sig-prename descclassname\"> EXTENSIONS</span><a class=\"heading-anchor\" href=\"#cmdoption-startproject-extension\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies which file extensions in the project template should be rendered with\nthe template engine. Defaults to <code class=\"docutils literal notranslate\">py</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startproject-name\">\n<span id=\"cmdoption-startproject-n\"></span><span class=\"sig-name descname\">--name</span><span class=\"sig-prename descclassname\"> FILES</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-n</span><span class=\"sig-prename descclassname\"> FILES</span><a class=\"heading-anchor\" href=\"#cmdoption-startproject-name\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies which files in the project template (in addition to those matching\n<code class=\"docutils literal notranslate\">--extension</code>) should be rendered with the template engine. Defaults to an\nempty list.</p>\n<p>The <a class=\"reference internal\" href=\"/pl/2.1/ref/templates/api/#django.template.Context\" title=\"django.template.Context\"><code class=\"xref py py-class docutils literal notranslate\">template context</code></a> used is:</p>\n<ul class=\"simple\">\n<li><p>Any option passed to the <code class=\"docutils literal notranslate\">startproject</code> command (among the command’s\nsupported options)</p></li>\n<li><p><code class=\"docutils literal notranslate\">project_name</code> – the project name as passed to the command</p></li>\n<li><p><code class=\"docutils literal notranslate\">project_directory</code> – the full path of the newly created project</p></li>\n<li><p><code class=\"docutils literal notranslate\">secret_key</code> – a random key for the <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\">SECRET_KEY</code></a> setting</p></li>\n<li><p><code class=\"docutils literal notranslate\">docs_version</code> – the version of the documentation: <code class=\"docutils literal notranslate\">'dev'</code> or <code class=\"docutils literal notranslate\">'1.x'</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">django_version</code> – the version of Django, e.g.``»2.0.3»``</p></li>\n</ul>\n<p>Please also see the <a class=\"reference internal\" href=\"#render-warning\"><span class=\"std std-ref\">rendering warning</span></a> as mentioned\nfor <a class=\"reference internal\" href=\"#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\">startapp</code></a>.</p>\n</section>\n<section id=\"test\">\n<h3><code class=\"docutils literal notranslate\">test</code><a class=\"heading-anchor\" href=\"#test\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-test\">\n<span class=\"sig-name descname\">django-admin test [test_label [test_label ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-test\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs tests for all installed apps. See <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/\"><span class=\"doc\">Testing in Django</span></a> for more\ninformation.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-failfast\">\n<span class=\"sig-name descname\">--failfast</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-failfast\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Stops running tests and reports the failure immediately after a test fails.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-testrunner\">\n<span class=\"sig-name descname\">--testrunner</span><span class=\"sig-prename descclassname\"> TESTRUNNER</span><a class=\"heading-anchor\" href=\"#cmdoption-test-testrunner\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Controls the test runner class that is used to execute tests. This value\noverrides the value provided by the <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-TEST_RUNNER\"><code class=\"xref std std-setting docutils literal notranslate\">TEST_RUNNER</code></a> setting.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-noinput\">\n<span id=\"cmdoption-test-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts. A typical prompt is a warning about deleting an\nexisting test database.</p>\n<section id=\"test-runner-options\">\n<h4>Test runner options<a class=\"heading-anchor\" href=\"#test-runner-options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>The <code class=\"docutils literal notranslate\">test</code> command receives options on behalf of the specified\n<a class=\"reference internal\" href=\"#cmdoption-test-testrunner\"><code class=\"xref std std-option docutils literal notranslate\">--testrunner</code></a>. These are the options of the default test runner:\n<a class=\"reference internal\" href=\"/pl/2.1/topics/testing/advanced/#django.test.runner.DiscoverRunner\" title=\"django.test.runner.DiscoverRunner\"><code class=\"xref py py-class docutils literal notranslate\">DiscoverRunner</code></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-keepdb\">\n<span id=\"cmdoption-test-k\"></span><span class=\"sig-name descname\">--keepdb</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-k</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-keepdb\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Preserves the test database between test runs. This has the advantage of\nskipping both the create and destroy actions which can greatly decrease the\ntime to run tests, especially those in a large test suite. If the test database\ndoes not exist, it will be created on the first run and then preserved for each\nsubsequent run. Any unapplied migrations will also be applied to the test\ndatabase before running the test suite.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-reverse\">\n<span id=\"cmdoption-test-r\"></span><span class=\"sig-name descname\">--reverse</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-r</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-reverse\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Sorts test cases in the opposite execution order. This may help in debugging\nthe side effects of tests that aren’t properly isolated. <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/overview/#order-of-tests\"><span class=\"std std-ref\">Grouping by test\nclass</span></a> is preserved when using this option.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-debug-mode\">\n<span class=\"sig-name descname\">--debug-mode</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-debug-mode\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Sets the <a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-DEBUG\"><code class=\"xref std std-setting docutils literal notranslate\">DEBUG</code></a> setting to <code class=\"docutils literal notranslate\">True</code> prior to running tests. This may\nhelp troubleshoot test failures.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-debug-sql\">\n<span id=\"cmdoption-test-d\"></span><span class=\"sig-name descname\">--debug-sql</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-d</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-debug-sql\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Enables <a class=\"reference internal\" href=\"/pl/2.1/topics/logging/#django-db-logger\"><span class=\"std std-ref\">SQL logging</span></a> for failing tests. If\n<code class=\"docutils literal notranslate\">--verbosity</code> is <code class=\"docutils literal notranslate\">2</code>, then queries in passing tests are also output.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-parallel\">\n<span class=\"sig-name descname\">--parallel</span><span class=\"sig-prename descclassname\"> [N]</span><a class=\"heading-anchor\" href=\"#cmdoption-test-parallel\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs tests in separate parallel processes. Since modern processors have\nmultiple cores, this allows running tests significantly faster.</p>\n<p>By default <code class=\"docutils literal notranslate\">--parallel</code> runs one process per core according to\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count\" title=\"(w Python v3.14)\"><code class=\"xref py py-func docutils literal notranslate\">multiprocessing.cpu_count()</code></a>. You can adjust the number of processes\neither by providing it as the option’s value, e.g. <code class=\"docutils literal notranslate\">--parallel=4</code>, or by\nsetting the <code class=\"docutils literal notranslate\">DJANGO_TEST_PROCESSES</code> environment variable.</p>\n<p>Django distributes test cases — <a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#unittest.TestCase\" title=\"(w Python v3.14)\"><code class=\"xref py py-class docutils literal notranslate\">unittest.TestCase</code></a> subclasses — to\nsubprocesses. If there are fewer test cases than configured processes, Django\nwill reduce the number of processes accordingly.</p>\n<p>Each process gets its own database. You must ensure that different test cases\ndon’t access the same resources. For instance, test cases that touch the\nfilesystem should create a temporary directory for their own use.</p>\n<p>This option requires the third-party <code class=\"docutils literal notranslate\">tblib</code> package to display tracebacks\ncorrectly:</p>\n<div class=\"code-block\" data-language=\"console\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Shell</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Shell code\"><code><span class=\"gp\">$ </span>pip install tblib\n</code></pre></div>\n<p>This feature isn’t available on Windows. It doesn’t work with the Oracle\ndatabase backend either.</p>\n<p>If you want to use <a class=\"reference external\" href=\"https://docs.python.org/3/library/pdb.html#module-pdb\" title=\"(w Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">pdb</code></a> while debugging tests, you must disable parallel\nexecution (<code class=\"docutils literal notranslate\">--parallel=1</code>). You’ll see something like <code class=\"docutils literal notranslate\">bdb.BdbQuit</code> if you\ndon’t.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Ostrzeżenie</p>\n<p>When test parallelization is enabled and a test fails, Django may be\nunable to display the exception traceback. This can make debugging\ndifficult. If you encounter this problem, run the affected test without\nparallelization to see the traceback of the failure.</p>\n<p>This is a known limitation. It arises from the need to serialize objects\nin order to exchange them between processes. See\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/pickle.html#pickle-picklable\" title=\"(w Python v3.14)\"><span>What can be pickled and unpickled?</span></a> for details.</p>\n</aside>\n<dl class=\"std option\">\n<dt class=\"sig sig-object std\" id=\"cmdoption-test-tag\">\n<span class=\"sig-name descname\">--tag</span><span class=\"sig-prename descclassname\"> TAGS</span><a class=\"heading-anchor\" href=\"#cmdoption-test-tag\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs only tests <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/tools/#topics-tagging-tests\"><span class=\"std std-ref\">marked with the specified tags</span></a>.\nMay be specified multiple times and combined with <a class=\"reference internal\" href=\"#cmdoption-test-exclude-tag\"><code class=\"xref std std-option docutils literal notranslate\">test --exclude-tag</code></a>.</p>\n<dl class=\"std option\">\n<dt class=\"sig sig-object std\" id=\"cmdoption-test-exclude-tag\">\n<span class=\"sig-name descname\">--exclude-tag</span><span class=\"sig-prename descclassname\"> EXCLUDE_TAGS</span><a class=\"heading-anchor\" href=\"#cmdoption-test-exclude-tag\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Excludes tests <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/tools/#topics-tagging-tests\"><span class=\"std std-ref\">marked with the specified tags</span></a>.\nMay be specified multiple times and combined with <a class=\"reference internal\" href=\"#cmdoption-test-tag\"><code class=\"xref std std-option docutils literal notranslate\">test --tag</code></a>.</p>\n</section>\n</section>\n<section id=\"testserver\">\n<h3><code class=\"docutils literal notranslate\">testserver</code><a class=\"heading-anchor\" href=\"#testserver\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-testserver\">\n<span class=\"sig-name descname\">django-admin testserver [fixture [fixture ...]]</span><a class=\"heading-anchor\" href=\"#django-admin-testserver\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs a Django development server (as in <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a>) using data from\nthe given fixture(s).</p>\n<p>For example, this command:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin testserver mydata<span class=\"o\">.</span>json\n</code></pre></div>\n<p>…would perform the following steps:</p>\n<ol class=\"arabic simple\">\n<li><p>Create a test database, as described in <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/overview/#the-test-database\"><span class=\"std std-ref\">The test database</span></a>.</p></li>\n<li><p>Populate the test database with fixture data from the given fixtures.\n(For more on fixtures, see the documentation for <a class=\"reference internal\" href=\"#django-admin-loaddata\"><code class=\"xref std std-djadmin docutils literal notranslate\">loaddata</code></a> above.)</p></li>\n<li><p>Runs the Django development server (as in <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a>), pointed at\nthis newly created test database instead of your production database.</p></li>\n</ol>\n<p>This is useful in a number of ways:</p>\n<ul class=\"simple\">\n<li><p>When you’re writing <a class=\"reference internal\" href=\"/pl/2.1/topics/testing/overview/\"><span class=\"doc\">unit tests</span></a> of how your views\nact with certain fixture data, you can use <code class=\"docutils literal notranslate\">testserver</code> to interact with\nthe views in a Web browser, manually.</p></li>\n<li><p>Let’s say you’re developing your Django application and have a „pristine”\ncopy of a database that you’d like to interact with. You can dump your\ndatabase to a fixture (using the <a class=\"reference internal\" href=\"#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\">dumpdata</code></a> command, explained\nabove), then use <code class=\"docutils literal notranslate\">testserver</code> to run your Web application with that data.\nWith this arrangement, you have the flexibility of messing up your data\nin any way, knowing that whatever data changes you’re making are only\nbeing made to a test database.</p></li>\n</ul>\n<p>Note that this server does <em>not</em> automatically detect changes to your Python\nsource code (as <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a> does). It does, however, detect changes to\ntemplates.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-testserver-addrport\">\n<span class=\"sig-name descname\">--addrport</span><span class=\"sig-prename descclassname\"> ADDRPORT</span><a class=\"heading-anchor\" href=\"#cmdoption-testserver-addrport\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies a different port, or IP address and port, from the default of\n<code class=\"docutils literal notranslate\">127.0.0.1:8000</code>. This value follows exactly the same format and serves\nexactly the same function as the argument to the <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a> command.</p>\n<p>Examples:</p>\n<p>To run the test server on port 7000 with <code class=\"docutils literal notranslate\">fixture1</code> and <code class=\"docutils literal notranslate\">fixture2</code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin testserver <span class=\"o\">--</span>addrport <span class=\"mi\">7000</span> fixture1 fixture2\ndjango<span class=\"o\">-</span>admin testserver fixture1 fixture2 <span class=\"o\">--</span>addrport <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>(The above statements are equivalent. We include both of them to demonstrate\nthat it doesn’t matter whether the options come before or after the fixture\narguments.)</p>\n<p>To run on 1.2.3.4:7000 with a <code class=\"docutils literal notranslate\">test</code> fixture:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin testserver <span class=\"o\">--</span>addrport <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">7000</span> test\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-testserver-noinput\">\n<span id=\"cmdoption-testserver-no-input\"></span><span class=\"sig-name descname\">--noinput</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">--no-input</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-testserver-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Suppresses all user prompts. A typical prompt is a warning about deleting an\nexisting test database.</p>\n</section>\n</section>\n<section id=\"commands-provided-by-applications\">\n<h2>Commands provided by applications<a class=\"heading-anchor\" href=\"#commands-provided-by-applications\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Some commands are only available when the <code class=\"docutils literal notranslate\">django.contrib</code> application that\n<a class=\"reference internal\" href=\"/pl/2.1/howto/custom-management-commands/\"><span class=\"doc\">implements</span></a> them has been\n<a class=\"reference internal\" href=\"/pl/2.1/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">enabled</code></a>. This section describes them grouped by\ntheir application.</p>\n<section id=\"django-contrib-auth\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.auth</code><a class=\"heading-anchor\" href=\"#django-contrib-auth\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"changepassword\">\n<h4><code class=\"docutils literal notranslate\">changepassword</code><a class=\"heading-anchor\" href=\"#changepassword\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-changepassword\">\n<span class=\"sig-name descname\">django-admin changepassword [&lt;username&gt;]</span><a class=\"heading-anchor\" href=\"#django-admin-changepassword\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>This command is only available if Django’s <a class=\"reference internal\" href=\"/pl/2.1/topics/auth/\"><span class=\"doc\">authentication system</span></a> (<code class=\"docutils literal notranslate\">django.contrib.auth</code>) is installed.</p>\n<p>Allows changing a user’s password. It prompts you to enter a new password twice\nfor the given user. If the entries are identical, this immediately becomes the\nnew password. If you do not supply a user, the command will attempt to change\nthe password whose username matches the current user.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-changepassword-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-changepassword-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to query for the user. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin changepassword ringo\n</code></pre></div>\n</section>\n<section id=\"createsuperuser\">\n<h4><code class=\"docutils literal notranslate\">createsuperuser</code><a class=\"heading-anchor\" href=\"#createsuperuser\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-createsuperuser\">\n<span class=\"sig-name descname\">django-admin createsuperuser</span><a class=\"heading-anchor\" href=\"#django-admin-createsuperuser\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>This command is only available if Django’s <a class=\"reference internal\" href=\"/pl/2.1/topics/auth/\"><span class=\"doc\">authentication system</span></a> (<code class=\"docutils literal notranslate\">django.contrib.auth</code>) is installed.</p>\n<p>Creates a superuser account (a user who has all permissions). This is\nuseful if you need to create an initial superuser account or if you need to\nprogrammatically generate superuser accounts for your site(s).</p>\n<p>When run interactively, this command will prompt for a password for\nthe new superuser account. When run non-interactively, no password\nwill be set, and the superuser account will not be able to log in until\na password has been manually set for it.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createsuperuser-username\">\n<span class=\"sig-name descname\">--username</span><span class=\"sig-prename descclassname\"> USERNAME</span><a class=\"heading-anchor\" href=\"#cmdoption-createsuperuser-username\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createsuperuser-email\">\n<span class=\"sig-name descname\">--email</span><span class=\"sig-prename descclassname\"> EMAIL</span><a class=\"heading-anchor\" href=\"#cmdoption-createsuperuser-email\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>The username and email address for the new account can be supplied by\nusing the <code class=\"docutils literal notranslate\">--username</code> and <code class=\"docutils literal notranslate\">--email</code> arguments on the command\nline. If either of those is not supplied, <code class=\"docutils literal notranslate\">createsuperuser</code> will prompt for\nit when running interactively.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createsuperuser-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-createsuperuser-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database into which the superuser object will be saved.</p>\n<p>You can subclass the management command and override <code class=\"docutils literal notranslate\">get_input_data()</code> if you\nwant to customize data input and validation. Consult the source code for\ndetails on the existing implementation and the method’s parameters. For example,\nit could be useful if you have a <code class=\"docutils literal notranslate\">ForeignKey</code> in\n<a class=\"reference internal\" href=\"/pl/2.1/topics/auth/customizing/#django.contrib.auth.models.CustomUser.REQUIRED_FIELDS\" title=\"django.contrib.auth.models.CustomUser.REQUIRED_FIELDS\"><code class=\"xref py py-attr docutils literal notranslate\">REQUIRED_FIELDS</code></a> and want to\nallow creating an instance instead of entering the primary key of an existing\ninstance.</p>\n</section>\n</section>\n<section id=\"django-contrib-contenttypes\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.contenttypes</code><a class=\"heading-anchor\" href=\"#django-contrib-contenttypes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"remove-stale-contenttypes\">\n<h4><code class=\"docutils literal notranslate\">remove_stale_contenttypes</code><a class=\"heading-anchor\" href=\"#remove-stale-contenttypes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-remove_stale_contenttypes\">\n<span class=\"sig-name descname\">django-admin remove_stale_contenttypes</span><a class=\"heading-anchor\" href=\"#django-admin-remove_stale_contenttypes\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>This command is only available if Django’s <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/contenttypes/\"><span class=\"doc\">contenttypes app</span></a> (<a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/contenttypes/#module-django.contrib.contenttypes\" title=\"django.contrib.contenttypes: Provides generic interface to installed models.\"><code class=\"xref py py-mod docutils literal notranslate\">django.contrib.contenttypes</code></a>) is installed.</p>\n<p>Deletes stale content types (from deleted models) in your database. Any objects\nthat depend on the deleted content types will also be deleted. A list of\ndeleted objects will be displayed before you confirm it’s okay to proceed with\nthe deletion.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-remove_stale_contenttypes-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-remove_stale_contenttypes-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the database to use. Defaults to <code class=\"docutils literal notranslate\">default</code>.</p>\n</section>\n</section>\n<section id=\"django-contrib-gis\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.gis</code><a class=\"heading-anchor\" href=\"#django-contrib-gis\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"ogrinspect\">\n<h4><code class=\"docutils literal notranslate\">ogrinspect</code><a class=\"heading-anchor\" href=\"#ogrinspect\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>This command is only available if <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/gis/\"><span class=\"doc\">GeoDjango</span></a>\n(<code class=\"docutils literal notranslate\">django.contrib.gis</code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/gis/commands/#django-admin-ogrinspect\"><code class=\"xref std std-djadmin docutils literal notranslate\">description</code></a> in the GeoDjango\ndocumentation.</p>\n</section>\n</section>\n<section id=\"django-contrib-sessions\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.sessions</code><a class=\"heading-anchor\" href=\"#django-contrib-sessions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"clearsessions\">\n<h4><code class=\"docutils literal notranslate\">clearsessions</code><a class=\"heading-anchor\" href=\"#clearsessions\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<dl class=\"std django-admin\">\n<dt class=\"sig sig-object std\" id=\"django-admin-clearsessions\">\n<span class=\"sig-name descname\">django-admin clearsessions</span><a class=\"heading-anchor\" href=\"#django-admin-clearsessions\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Can be run as a cron job or directly to clean out expired sessions.</p>\n</section>\n</section>\n<section id=\"django-contrib-sitemaps\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.sitemaps</code><a class=\"heading-anchor\" href=\"#django-contrib-sitemaps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"ping-google\">\n<h4><code class=\"docutils literal notranslate\">ping_google</code><a class=\"heading-anchor\" href=\"#ping-google\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>This command is only available if the <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/sitemaps/\"><span class=\"doc\">Sitemaps framework</span></a> (<code class=\"docutils literal notranslate\">django.contrib.sitemaps</code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/sitemaps/#django-admin-ping_google\"><code class=\"xref std std-djadmin docutils literal notranslate\">description</code></a> in the Sitemaps\ndocumentation.</p>\n</section>\n</section>\n<section id=\"django-contrib-staticfiles\">\n<h3><code class=\"docutils literal notranslate\">django.contrib.staticfiles</code><a class=\"heading-anchor\" href=\"#django-contrib-staticfiles\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"collectstatic\">\n<h4><code class=\"docutils literal notranslate\">collectstatic</code><a class=\"heading-anchor\" href=\"#collectstatic\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>This command is only available if the <a class=\"reference internal\" href=\"/pl/2.1/howto/static-files/\"><span class=\"doc\">static files application</span></a> (<code class=\"docutils literal notranslate\">django.contrib.staticfiles</code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">description</code></a> in the\n<a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> documentation.</p>\n</section>\n<section id=\"findstatic\">\n<h4><code class=\"docutils literal notranslate\">findstatic</code><a class=\"heading-anchor\" href=\"#findstatic\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>This command is only available if the <a class=\"reference internal\" href=\"/pl/2.1/howto/static-files/\"><span class=\"doc\">static files application</span></a> (<code class=\"docutils literal notranslate\">django.contrib.staticfiles</code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/#django-admin-findstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">description</code></a> in the <a class=\"reference internal\" href=\"/pl/2.1/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> documentation.</p>\n</section>\n</section>\n</section>\n<section id=\"default-options\">\n<h2>Default options<a class=\"heading-anchor\" href=\"#default-options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Although some commands may allow their own custom options, every command\nallows for the following options:</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-pythonpath\">\n<span class=\"sig-name descname\">--pythonpath</span><span class=\"sig-prename descclassname\"> PYTHONPATH</span><a class=\"heading-anchor\" href=\"#cmdoption-pythonpath\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Adds the given filesystem path to the Python <a class=\"reference external\" href=\"https://www.diveinto.org/python3/your-first-python-program.html#importsearchpath\">import search path</a>. If this\nisn’t provided, <code class=\"docutils literal notranslate\">django-admin</code> will use the <code class=\"docutils literal notranslate\">PYTHONPATH</code> environment\nvariable.</p>\n<p>This option is unnecessary in <code class=\"docutils literal notranslate\">manage.py</code>, because it takes care of setting\nthe Python path for you.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin migrate <span class=\"o\">--</span>pythonpath<span class=\"o\">=</span><span class=\"s1\">&#39;/home/djangoprojects/myproject&#39;</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-settings\">\n<span class=\"sig-name descname\">--settings</span><span class=\"sig-prename descclassname\"> SETTINGS</span><a class=\"heading-anchor\" href=\"#cmdoption-settings\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the settings module to use. The settings module should be in Python\npackage syntax, e.g. <code class=\"docutils literal notranslate\">mysite.settings</code>. If this isn’t provided,\n<code class=\"docutils literal notranslate\">django-admin</code> will use the <code class=\"docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code> environment variable.</p>\n<p>This option is unnecessary in <code class=\"docutils literal notranslate\">manage.py</code>, because it uses\n<code class=\"docutils literal notranslate\">settings.py</code> from the current project by default.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin migrate <span class=\"o\">--</span>settings<span class=\"o\">=</span>mysite<span class=\"o\">.</span>settings\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-traceback\">\n<span class=\"sig-name descname\">--traceback</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-traceback\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Displays a full stack trace when a <a class=\"reference internal\" href=\"/pl/2.1/howto/custom-management-commands/#django.core.management.CommandError\" title=\"django.core.management.CommandError\"><code class=\"xref py py-exc docutils literal notranslate\">CommandError</code></a>\nis raised. By default, <code class=\"docutils literal notranslate\">django-admin</code> will show a simple error message when a\n<code class=\"docutils literal notranslate\">CommandError</code> occurs and a full stack trace for any other exception.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin migrate <span class=\"o\">--</span>traceback\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-verbosity\">\n<span id=\"cmdoption-v\"></span><span class=\"sig-name descname\">--verbosity</span><span class=\"sig-prename descclassname\"> {0,1,2,3}</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-v</span><span class=\"sig-prename descclassname\"> {0,1,2,3}</span><a class=\"heading-anchor\" href=\"#cmdoption-verbosity\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Specifies the amount of notification and debug information that a command\nshould print to the console.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">0</code> means no output.</p></li>\n<li><p><code class=\"docutils literal notranslate\">1</code> means normal output (default).</p></li>\n<li><p><code class=\"docutils literal notranslate\">2</code> means verbose output.</p></li>\n<li><p><code class=\"docutils literal notranslate\">3</code> means <em>very</em> verbose output.</p></li>\n</ul>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin migrate <span class=\"o\">--</span>verbosity <span class=\"mi\">2</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-no-color\">\n<span class=\"sig-name descname\">--no-color</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-no-color\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Disables colorized command output.  Some commands format their output to be\ncolorized. For example, errors will be printed to the console in red and SQL\nstatements will be syntax highlighted.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>django<span class=\"o\">-</span>admin runserver <span class=\"o\">--</span>no<span class=\"o\">-</span>color\n</code></pre></div>\n</section>\n<section id=\"extra-niceties\">\n<h2>Extra niceties<a class=\"heading-anchor\" href=\"#extra-niceties\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"syntax-coloring\">\n<span id=\"id1\"></span><h3>Syntax coloring<a class=\"heading-anchor\" href=\"#syntax-coloring\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The <code class=\"docutils literal notranslate\">django-admin</code> / <code class=\"docutils literal notranslate\">manage.py</code> commands will use pretty\ncolor-coded output if your terminal supports ANSI-colored output. It\nwon’t use the color codes if you’re piping the command’s output to\nanother program.</p>\n<p>Under Windows, the native console doesn’t support ANSI escape sequences so by\ndefault there is no color output. But you can install the <a class=\"reference external\" href=\"http://adoxa.altervista.org/ansicon/\">ANSICON</a>\nthird-party tool, the Django commands will detect its presence and will make\nuse of its services to color output just like on Unix-based platforms.</p>\n<p>The colors used for syntax highlighting can be customized. Django\nships with three color palettes:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">dark</code>, suited to terminals that show white text on a black\nbackground. This is the default palette.</p></li>\n<li><p><code class=\"docutils literal notranslate\">light</code>, suited to terminals that show black text on a white\nbackground.</p></li>\n<li><p><code class=\"docutils literal notranslate\">nocolor</code>, which disables syntax highlighting.</p></li>\n</ul>\n<p>You select a palette by setting a <code class=\"docutils literal notranslate\">DJANGO_COLORS</code> environment\nvariable to specify the palette you want to use. For example, to\nspecify the <code class=\"docutils literal notranslate\">light</code> palette under a Unix or OS/X BASH shell, you\nwould run the following at a command prompt:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>export DJANGO_COLORS<span class=\"o\">=</span><span class=\"s2\">&quot;light&quot;</span>\n</code></pre></div>\n<p>You can also customize the colors that are used. Django specifies a\nnumber of roles in which color is used:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">error</code> - A major error.</p></li>\n<li><p><code class=\"docutils literal notranslate\">notice</code> - A minor error.</p></li>\n<li><p><code class=\"docutils literal notranslate\">success</code> - A success.</p></li>\n<li><p><code class=\"docutils literal notranslate\">warning</code> - A warning.</p></li>\n<li><p><code class=\"docutils literal notranslate\">sql_field</code> - The name of a model field in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\">sql_coltype</code> - The type of a model field in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\">sql_keyword</code> - An SQL keyword.</p></li>\n<li><p><code class=\"docutils literal notranslate\">sql_table</code> - The name of a model in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_info</code> - A 1XX HTTP Informational server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_success</code> - A 2XX HTTP Success server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_not_modified</code> - A 304 HTTP Not Modified server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_redirect</code> - A 3XX HTTP Redirect server response other than 304.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_not_found</code> - A 404 HTTP Not Found server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_bad_request</code> - A 4XX HTTP Bad Request server response other than 404.</p></li>\n<li><p><code class=\"docutils literal notranslate\">http_server_error</code> - A 5XX HTTP Server Error response.</p></li>\n<li><p><code class=\"docutils literal notranslate\">migrate_heading</code> - A heading in a migrations management command.</p></li>\n<li><p><code class=\"docutils literal notranslate\">migrate_label</code> - A migration name.</p></li>\n</ul>\n<p>Each of these roles can be assigned a specific foreground and\nbackground color, from the following list:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">black</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">red</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">green</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">yellow</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">blue</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">magenta</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">cyan</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">white</code></p></li>\n</ul>\n<p>Each of these colors can then be modified by using the following\ndisplay options:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">bold</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">underscore</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">blink</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">reverse</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">conceal</code></p></li>\n</ul>\n<p>A color specification follows one of the following patterns:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\">role=fg</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">role=fg/bg</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">role=fg,option,option</code></p></li>\n<li><p><code class=\"docutils literal notranslate\">role=fg/bg,option,option</code></p></li>\n</ul>\n<p>where <code class=\"docutils literal notranslate\">role</code> is the name of a valid color role, <code class=\"docutils literal notranslate\">fg</code> is the\nforeground color, <code class=\"docutils literal notranslate\">bg</code> is the background color and each <code class=\"docutils literal notranslate\">option</code>\nis one of the color modifying options. Multiple color specifications\nare then separated by a semicolon. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>export DJANGO_COLORS<span class=\"o\">=</span><span class=\"s2\">&quot;error=yellow/blue,blink;notice=magenta&quot;</span>\n</code></pre></div>\n<p>would specify that errors be displayed using blinking yellow on blue,\nand notices displayed using magenta. All other color roles would be\nleft uncolored.</p>\n<p>Colors can also be specified by extending a base palette. If you put\na palette name in a color specification, all the colors implied by that\npalette will be loaded. So:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>export DJANGO_COLORS<span class=\"o\">=</span><span class=\"s2\">&quot;light;error=yellow/blue,blink;notice=magenta&quot;</span>\n</code></pre></div>\n<p>would specify the use of all the colors in the light color palette,\n<em>except</em> for the colors for errors and notices which would be\noverridden as specified.</p>\n</section>\n<section id=\"bash-completion\">\n<h3>Bash completion<a class=\"heading-anchor\" href=\"#bash-completion\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>If you use the Bash shell, consider installing the Django bash completion\nscript, which lives in <code class=\"docutils literal notranslate\">extras/django_bash_completion</code> in the Django source\ndistribution. It enables tab-completion of <code class=\"docutils literal notranslate\">django-admin</code> and\n<code class=\"docutils literal notranslate\">manage.py</code> commands, so you can, for instance…</p>\n<ul class=\"simple\">\n<li><p>Type <code class=\"docutils literal notranslate\">django-admin</code>.</p></li>\n<li><p>Press [TAB] to see all available options.</p></li>\n<li><p>Type <code class=\"docutils literal notranslate\">sql</code>, then [TAB], to see all available options whose names start\nwith <code class=\"docutils literal notranslate\">sql</code>.</p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/pl/2.1/howto/custom-management-commands/\"><span class=\"doc\">Pisanie własnych komend django-admin</span></a> for how to add customized actions.</p>\n</section>\n</section>\n</section>\n<section id=\"running-management-commands-from-your-code\">\n<h1>Running management commands from your code<a class=\"heading-anchor\" href=\"#running-management-commands-from-your-code\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<dl class=\"py function\">\n<dt class=\"sig sig-object py\" id=\"django.core.management.call_command\">\n<span class=\"sig-prename descclassname\">django.core.management.</span><span class=\"sig-name descname\">call_command</span><span class=\"sig-paren\">(</span><em class=\"sig-param\">name</em>, <em class=\"sig-param\"><span class=\"o\">*</span>args</em>, <em class=\"sig-param\"><span class=\"o\">**</span>options</em><span class=\"sig-paren\">)</span><a class=\"heading-anchor\" href=\"#django.core.management.call_command\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>To call a management command from code use <code class=\"docutils literal notranslate\">call_command</code>.</p>\n<dl class=\"simple\">\n<dt><code class=\"docutils literal notranslate\">name</code></dt><dd><p>the name of the command to call or a command object. Passing the name is\npreferred unless the object is required for testing.</p>\n</dd>\n<dt><code class=\"docutils literal notranslate\">*args</code></dt><dd><p>a list of arguments accepted by the command. Arguments are passed to the\nargument parser, so you can use the same style as you would on the command\nline. For example, <code class=\"docutils literal notranslate\">call_command('flush', '--verbosity=0')</code>.</p>\n</dd>\n<dt><code class=\"docutils literal notranslate\">**options</code></dt><dd><p>named options accepted on the command-line. Options are passed to the command\nwithout triggering the argument parser, which means you’ll need to pass the\ncorrect type. For example, <code class=\"docutils literal notranslate\">call_command('flush', verbosity=0)</code> (zero must\nbe an integer rather than a string).</p>\n</dd>\n</dl>\n<p>Examples:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span> <span class=\"nn\">django.core</span> <span class=\"kn\">import</span> management\n<span class=\"kn\">from</span> <span class=\"nn\">django.core.management.commands</span> <span class=\"kn\">import</span> loaddata\n\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;flush&#39;</span><span class=\"p\">,</span> verbosity<span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> interactive<span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;loaddata&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;test_data&#39;</span><span class=\"p\">,</span> verbosity<span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">)</span>\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span>loaddata<span class=\"o\">.</span>Command<span class=\"p\">(),</span> <span class=\"s1\">&#39;test_data&#39;</span><span class=\"p\">,</span> verbosity<span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>Note that command options that take no arguments are passed as keywords\nwith <code class=\"docutils literal notranslate\">True</code> or <code class=\"docutils literal notranslate\">False</code>, as you can see with the <code class=\"docutils literal notranslate\">interactive</code> option above.</p>\n<p>Named arguments can be passed by using either one of the following syntaxes:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"c1\"># Similar to the command line</span>\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--natural-foreign&#39;</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># Named argument similar to the command line minus the initial dashes and</span>\n<span class=\"c1\"># with internal dashes replaced by underscores</span>\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> natural_foreign<span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># `use_natural_foreign_keys` is the option destination variable</span>\nmanagement<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> use_natural_foreign_keys<span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>Some command options have different names when using <code class=\"docutils literal notranslate\">call_command()</code> instead\nof <code class=\"docutils literal notranslate\">django-admin</code> or <code class=\"docutils literal notranslate\">manage.py</code>. For example, <code class=\"docutils literal notranslate\">django-admin\ncreatesuperuser --no-input</code> translates to <code class=\"docutils literal notranslate\">call_command('createsuperuser',\ninteractive=False)</code>. To find what keyword argument name to use for\n<code class=\"docutils literal notranslate\">call_command()</code>, check the command’s source code for the <code class=\"docutils literal notranslate\">dest</code> argument\npassed to <code class=\"docutils literal notranslate\">parser.add_argument()</code>.</p>\n<p>Command options which take multiple options are passed a list:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code>management<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> exclude<span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;contenttypes&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;auth&#39;</span><span class=\"p\">])</span>\n</code></pre></div>\n<p>The return value of the <code class=\"docutils literal notranslate\">call_command()</code> function is the same as the return\nvalue of the <code class=\"docutils literal notranslate\">handle()</code> method of the command.</p>\n<section id=\"output-redirection\">\n<h2>Output redirection<a class=\"heading-anchor\" href=\"#output-redirection\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Note that you can redirect standard output and error streams as all commands\nsupport the <code class=\"docutils literal notranslate\">stdout</code> and <code class=\"docutils literal notranslate\">stderr</code> options. For example, you could write:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"k\">with</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"s1\">&#39;/path/to/command_output&#39;</span><span class=\"p\">)</span> <span class=\"k\">as</span> f<span class=\"p\">:</span>\n    management<span class=\"o\">.</span>call_command<span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> stdout<span class=\"o\">=</span>f<span class=\"p\">)</span>\n</code></pre></div>\n</section>\n</section>\n","rootId":"","toc":[{"title":"django-admin and manage.py","anchor":"","children":[{"title":"Usage","anchor":"usage","children":[{"title":"Getting runtime help","anchor":"getting-runtime-help","children":[]},{"title":"App names","anchor":"app-names","children":[]},{"title":"Determining the version","anchor":"determining-the-version","children":[]},{"title":"Displaying debug output","anchor":"displaying-debug-output","children":[]}]},{"title":"Available commands","anchor":"available-commands","children":[{"title":"check","anchor":"check","children":[]},{"title":"compilemessages","anchor":"compilemessages","children":[]},{"title":"createcachetable","anchor":"createcachetable","children":[]},{"title":"dbshell","anchor":"dbshell","children":[]},{"title":"diffsettings","anchor":"diffsettings","children":[]},{"title":"dumpdata","anchor":"dumpdata","children":[]},{"title":"flush","anchor":"flush","children":[]},{"title":"inspectdb","anchor":"inspectdb","children":[]},{"title":"loaddata","anchor":"loaddata","children":[{"title":"What’s a „fixture”?","anchor":"what-s-a-fixture","children":[]},{"title":"Compressed fixtures","anchor":"compressed-fixtures","children":[]},{"title":"Database-specific fixtures","anchor":"database-specific-fixtures","children":[]},{"title":"Loading fixtures from stdin","anchor":"loading-fixtures-from-stdin","children":[]}]},{"title":"makemessages","anchor":"makemessages","children":[]},{"title":"makemigrations","anchor":"makemigrations","children":[]},{"title":"migrate","anchor":"migrate","children":[]},{"title":"runserver","anchor":"runserver","children":[{"title":"Examples of using different ports and addresses","anchor":"examples-of-using-different-ports-and-addresses","children":[]},{"title":"Serving static files with the development server","anchor":"serving-static-files-with-the-development-server","children":[]}]},{"title":"sendtestemail","anchor":"sendtestemail","children":[]},{"title":"shell","anchor":"shell","children":[]},{"title":"showmigrations","anchor":"showmigrations","children":[]},{"title":"sqlflush","anchor":"sqlflush","children":[]},{"title":"sqlmigrate","anchor":"sqlmigrate","children":[]},{"title":"sqlsequencereset","anchor":"sqlsequencereset","children":[]},{"title":"squashmigrations","anchor":"squashmigrations","children":[]},{"title":"startapp","anchor":"startapp","children":[]},{"title":"startproject","anchor":"startproject","children":[]},{"title":"test","anchor":"test","children":[{"title":"Test runner options","anchor":"test-runner-options","children":[]}]},{"title":"testserver","anchor":"testserver","children":[]}]},{"title":"Commands provided by applications","anchor":"commands-provided-by-applications","children":[{"title":"django.contrib.auth","anchor":"django-contrib-auth","children":[{"title":"changepassword","anchor":"changepassword","children":[]},{"title":"createsuperuser","anchor":"createsuperuser","children":[]}]},{"title":"django.contrib.contenttypes","anchor":"django-contrib-contenttypes","children":[{"title":"remove_stale_contenttypes","anchor":"remove-stale-contenttypes","children":[]}]},{"title":"django.contrib.gis","anchor":"django-contrib-gis","children":[{"title":"ogrinspect","anchor":"ogrinspect","children":[]}]},{"title":"django.contrib.sessions","anchor":"django-contrib-sessions","children":[{"title":"clearsessions","anchor":"clearsessions","children":[]}]},{"title":"django.contrib.sitemaps","anchor":"django-contrib-sitemaps","children":[{"title":"ping_google","anchor":"ping-google","children":[]}]},{"title":"django.contrib.staticfiles","anchor":"django-contrib-staticfiles","children":[{"title":"collectstatic","anchor":"collectstatic","children":[]},{"title":"findstatic","anchor":"findstatic","children":[]}]}]},{"title":"Default options","anchor":"default-options","children":[]},{"title":"Extra niceties","anchor":"extra-niceties","children":[{"title":"Syntax coloring","anchor":"syntax-coloring","children":[]},{"title":"Bash completion","anchor":"bash-completion","children":[]}]}]},{"title":"Running management commands from your code","anchor":"running-management-commands-from-your-code","children":[{"title":"Output redirection","anchor":"output-redirection","children":[]}]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/pl/2.1/ref/"}],"prev":{"docname":"ref/databases","title":"Databases","url":"/pl/2.1/ref/databases/"},"next":{"docname":"ref/exceptions","title":"Django Exceptions","url":"/pl/2.1/ref/exceptions/"},"formats":{"html":"/pl/2.1/ref/django-admin/","markdown":"/pl/2.1/ref/django-admin.md","json":"/pl/2.1/ref/django-admin.json"},"source":"https://github.com/django/django/blob/stable/2.1.x/docs/ref/django-admin.txt","official":"https://docs.djangoproject.com/pl/2.1/ref/django-admin/","inVersions":["6.1","6.0","5.2","5.1","5.0","4.2","4.1","4.0","3.2","3.1","3.0","2.2","2.1","2.0","1.11","1.10"],"inLocales":["en","zh-hans","fr","ja","id","pt-br","ko","es","el","pl"]}