{"title":"django-admin and manage.py","version":"6.0","locale":"es","docname":"ref/django-admin","url":"/es/6.0/ref/django-admin/","canonical":"https://djangodocs.dev/es/6.0/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. It\ndoes the same thing as <code class=\"docutils literal notranslate\">django-admin</code> but also sets the\n<span class=\"target\" id=\"index-0\"></span><a class=\"reference internal\" href=\"/es/6.0/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code></a> environment variable so that it points to your\nproject’s <code class=\"docutils literal notranslate\">settings.py</code> file.</p>\n<p>The <code class=\"docutils literal notranslate\">django-admin</code> script should be on your system path if you installed\nDjango via <code class=\"docutils literal notranslate\">pip</code>. If it’s not in your path, ensure you have your virtual\nenvironment activated.</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=\"/es/6.0/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 the\npackage containing your models. For example, if your <a class=\"reference internal\" href=\"/es/6.0/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=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</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=\"Text code\"><code>1.4.dev17026\n1.4a1\n1.4\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>, where it is supported, to specify the amount of\nnotification and debug information 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=\"/es/6.0/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=\"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=\"go\">django-admin check auth admin myapp</span>\n</code></pre></div>\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=\"/es/6.0/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=\"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=\"go\">django-admin check --tag models --tag compatibility</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-database\">\n<span class=\"sig-name descname\">--database</span><span class=\"sig-prename descclassname\"> DATABASE</span><a class=\"heading-anchor\" href=\"#cmdoption-check-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 run checks requiring database access:</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=\"go\">django-admin check --database default --database other</span>\n</code></pre></div>\n<p>By default, these checks will not be run.</p>\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\nsetting.</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\nsettings, you will probably want to point the <code class=\"docutils literal notranslate\">check</code> command at a different\nsettings module, either by setting the <span class=\"target\" id=\"index-3\"></span><a class=\"reference internal\" href=\"/es/6.0/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code></a>\nenvironment variable, or by passing the <code class=\"docutils literal notranslate\">--settings</code> option:</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=\"go\">django-admin check --deploy --settings=production_settings</span>\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=\"/es/6.0/topics/i18n/\"><span class=\"doc\">Internacionalización y localización</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 <a class=\"reference external\" href=\"https://www.gnu.org/software/gettext/manual/html_node/Fuzzy-Entries.html\">fuzzy translations</a> into compiled files.</p>\n<p>Example usage:</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=\"go\">django-admin compilemessages --locale=pt_BR</span>\n<span class=\"go\">django-admin compilemessages --locale=pt_BR --locale=fr -f</span>\n<span class=\"go\">django-admin compilemessages -l pt_BR</span>\n<span class=\"go\">django-admin compilemessages -l pt_BR -l fr --use-fuzzy</span>\n<span class=\"go\">django-admin compilemessages --exclude=pt_BR</span>\n<span class=\"go\">django-admin compilemessages --exclude=pt_BR --exclude=fr</span>\n<span class=\"go\">django-admin compilemessages -x pt_BR</span>\n<span class=\"go\">django-admin compilemessages -x pt_BR -x fr</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-compilemessages-ignore\">\n<span id=\"cmdoption-compilemessages-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-compilemessages-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 directories matching the given <a class=\"reference external\" href=\"https://docs.python.org/3/library/glob.html#module-glob\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-mod docutils literal notranslate\">glob</code></a>-style pattern. Use\nmultiple times to ignore more.</p>\n<p>Example usage:</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=\"go\">django-admin compilemessages --ignore=cache --ignore=outdated/*/locale</span>\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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/ref/settings/#std-setting-USER\"><code class=\"xref std std-setting docutils literal notranslate\">USER</code></a>, <a class=\"reference internal\" href=\"/es/6.0/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 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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dbshell-0\">\n<span class=\"sig-name descname\">--</span><span class=\"sig-prename descclassname\"> ARGUMENTS</span><a class=\"heading-anchor\" href=\"#cmdoption-dbshell-0\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Any arguments following a <code class=\"docutils literal notranslate\">--</code> divider will be passed on to the underlying\ncommand-line client. For example, with PostgreSQL you can use the <code class=\"docutils literal notranslate\">psql</code>\ncommand’s <code class=\"docutils literal notranslate\">-c</code> flag to execute a raw SQL query directly:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-7-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 dbshell -- -c <span class=\"s1\">&#39;select current_user&#39;</span>\n<span class=\"go\"> current_user</span>\n<span class=\"go\">--------------</span>\n<span class=\"go\"> postgres</span>\n<span class=\"gp gp-VirtualEnv\">(1 row)</span>\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-7-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 dbshell -- -c &#39;select current_user&#39;\n<span class=\"go\"> current_user</span>\n<span class=\"go\">--------------</span>\n<span class=\"go\"> postgres</span>\n<span class=\"gp gp-VirtualEnv\">(1 row)</span>\n</code></pre></div></div></div>\n<p>On MySQL/MariaDB, you can do this with the <code class=\"docutils literal notranslate\">mysql</code> command’s <code class=\"docutils literal notranslate\">-e</code> flag:</p>\n<div class=\"console\" data-console><div class=\"console-panel\" data-platform=\"unix\"><p class=\"console-label\" id=\"console-8-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 dbshell -- -e <span class=\"s2\">&quot;select user()&quot;</span>\n<span class=\"go\">+----------------------+</span>\n<span class=\"go\">| user()               |</span>\n<span class=\"go\">+----------------------+</span>\n<span class=\"go\">| djangonaut@localhost |</span>\n<span class=\"go\">+----------------------+</span>\n</code></pre></div>\n</div><div class=\"console-panel\" data-platform=\"windows\"><p class=\"console-label\" id=\"console-8-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 dbshell -- -e <span class=\"s2\">&quot;select user()&quot;</span>\n<span class=\"go\">+----------------------+</span>\n<span class=\"go\">| user()               |</span>\n<span class=\"go\">+----------------------+</span>\n<span class=\"go\">| djangonaut@localhost |</span>\n<span class=\"go\">+----------------------+</span>\n</code></pre></div></div></div>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>Be aware that not all options set in the <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-OPTIONS\"><code class=\"xref std std-setting docutils literal notranslate\">OPTIONS</code></a> part of your\ndatabase configuration in <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\">DATABASES</code></a> are passed to the\ncommand-line client, e.g. <code class=\"docutils literal notranslate\">'isolation_level'</code>.</p>\n</aside>\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=\"/es/6.0/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=\"/es/6.0/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<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>When result of <code class=\"docutils literal notranslate\">dumpdata</code> is saved as a file, it can serve as a\n<a class=\"reference internal\" href=\"/es/6.0/topics/db/fixtures/#fixtures-explanation\"><span class=\"std std-ref\">fixture</span></a> for\n<a class=\"reference internal\" href=\"/es/6.0/topics/testing/tools/#topics-testing-fixtures\"><span class=\"std std-ref\">tests</span></a> or as an\n<a class=\"reference internal\" href=\"/es/6.0/howto/initial-data/#initial-data-via-fixtures\"><span class=\"std std-ref\">initial data</span></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=\"/es/6.0/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\nthe objects 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=\"/es/6.0/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, then\nonly that model will be excluded, rather than the entire application. You can\nalso 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=\"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=\"go\">django-admin dumpdata --exclude=auth --exclude=contenttypes</span>\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=\"/es/6.0/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 id=\"fixtures-compression\">\n<h4>Fixtures compression<a class=\"heading-anchor\" href=\"#fixtures-compression\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>The output file can be compressed with one of the <code class=\"docutils literal notranslate\">bz2</code>, <code class=\"docutils literal notranslate\">gz</code>, <code class=\"docutils literal notranslate\">lzma</code>, or\n<code class=\"docutils literal notranslate\">xz</code> formats by ending the filename with the corresponding extension.\nFor example, to output the data as a compressed JSON file:</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=\"go\">django-admin dumpdata -o mydata.json.gz</span>\n</code></pre></div>\n</section>\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 rerun 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=\"/es/6.0/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. Models for partition tables are\ncreated on PostgreSQL if the <a class=\"reference internal\" href=\"#cmdoption-inspectdb-include-partitions\"><code class=\"xref std std-option docutils literal notranslate\">--include-partitions</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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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 =\nFalse</code> in the model’s <code class=\"docutils literal notranslate\">Meta</code> class tells Django not to manage each table’s\ncreation, modification, and deletion. If you do want to allow Django to manage\nthe table’s lifecycle, you’ll need to change the\n<a class=\"reference internal\" href=\"/es/6.0/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 remove it\nbecause <code class=\"docutils literal notranslate\">True</code> is its default value).</p>\n<section id=\"database-specific-notes\">\n<h4>Database-specific notes<a class=\"heading-anchor\" href=\"#database-specific-notes\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<section id=\"oracle\">\n<h5>Oracle<a class=\"heading-anchor\" href=\"#oracle\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<ul class=\"simple\">\n<li><p>Models are created for materialized views if <a class=\"reference internal\" href=\"#cmdoption-inspectdb-include-views\"><code class=\"xref std std-option docutils literal notranslate\">--include-views</code></a> is\nused.</p></li>\n</ul>\n</section>\n<section id=\"postgresql\">\n<h5>PostgreSQL<a class=\"heading-anchor\" href=\"#postgresql\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h5>\n<ul class=\"simple\">\n<li><p>Models are created for foreign tables.</p></li>\n<li><p>Models are created for materialized views if\n<a class=\"reference internal\" href=\"#cmdoption-inspectdb-include-views\"><code class=\"xref std std-option docutils literal notranslate\">--include-views</code></a> is used.</p></li>\n<li><p>Models are created for partition tables if\n<a class=\"reference internal\" href=\"#cmdoption-inspectdb-include-partitions\"><code class=\"xref std std-option docutils literal notranslate\">--include-partitions</code></a> is used.</p></li>\n</ul>\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-partitions\">\n<span class=\"sig-name descname\">--include-partitions</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-inspectdb-include-partitions\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>If this option is provided, models are also created for partitions.</p>\n<p>Only support for PostgreSQL is implemented.</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<p>If this option is provided, models are also created for database views.</p>\n</section>\n</section>\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\n<a class=\"reference internal\" href=\"/es/6.0/topics/db/fixtures/#fixtures-explanation\"><span class=\"std std-ref\">fixture</span></a> 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<p>Specifies the <a class=\"reference internal\" href=\"/es/6.0/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=\"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<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=\"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=\"go\">django-admin loaddata --format=json -</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=\"/es/6.0/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=\"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=\"go\">django-admin dumpdata --format=json --database=test app_label.ModelName | django-admin loaddata --format=json --database=prod -</span>\n</code></pre></div>\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<aside class=\"admonition admonition-seealso\" role=\"note\">\n<p class=\"admonition-title\">Ver también</p>\n<p>For more detail about fixtures see the <a class=\"reference internal\" href=\"/es/6.0/topics/db/fixtures/#fixtures-explanation\"><span class=\"std std-ref\">Fixtures</span></a> topic.</p>\n</aside>\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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/ref/settings/#std-setting-LOCALE_PATHS\"><code class=\"xref std std-setting docutils literal notranslate\">LOCALE_PATHS</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\">djangojs</code>).</p>\n<p>Example usage:</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=\"go\">django-admin makemessages --locale=de --extension xhtml</span>\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=\"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=\"go\">django-admin makemessages --locale=de --extension=html,txt --extension xml</span>\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=\"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=\"go\">django-admin makemessages --locale=pt_BR</span>\n<span class=\"go\">django-admin makemessages --locale=pt_BR --locale=fr</span>\n<span class=\"go\">django-admin makemessages -l pt_BR</span>\n<span class=\"go\">django-admin makemessages -l pt_BR -l fr</span>\n<span class=\"go\">django-admin makemessages --exclude=pt_BR</span>\n<span class=\"go\">django-admin makemessages --exclude=pt_BR --exclude=fr</span>\n<span class=\"go\">django-admin makemessages -x pt_BR</span>\n<span class=\"go\">django-admin makemessages -x pt_BR -x fr</span>\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=\"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=\"go\">django-admin makemessages --locale=de --symlinks</span>\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=\"(en Python versión 3.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=\"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=\"go\">django-admin makemessages --locale=en_US --ignore=apps/* --ignore=secret/*.html</span>\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<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-no-obsolete\">\n<span class=\"sig-name descname\">--no-obsolete</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemessages-no-obsolete\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Removes obsolete message strings from the <code class=\"docutils literal notranslate\">.po</code> files.</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\">Ver también</p>\n<p>See <a class=\"reference internal\" href=\"/es/6.0/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=\"/es/6.0/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. The\nname must be a valid Python <a class=\"reference external\" href=\"https://docs.python.org/3/reference/lexical_analysis.html#identifiers\" title=\"(en Python versión 3.14)\"><span class=\"xref std std-ref\">identifier</span></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-no-header\">\n<span class=\"sig-name descname\">--no-header</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-no-header\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Generate migration files without Django version and timestamp header.</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. Implies <code class=\"docutils literal notranslate\">--dry-run</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-scriptable\">\n<span class=\"sig-name descname\">--scriptable</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-scriptable\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Diverts log output and input prompts to <code class=\"docutils literal notranslate\">stderr</code>, writing only paths of\ngenerated migration files to <code class=\"docutils literal notranslate\">stdout</code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-update\">\n<span class=\"sig-name descname\">--update</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-update\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Merges model changes into the latest migration and optimize the resulting\noperations.</p>\n<p>The updated migration will have a generated name. In order to preserve the\nprevious name, set it using <code class=\"docutils literal notranslate\">--name</code>.</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=\"/es/6.0/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. You can use a prefix of the migration\nname, e.g. <code class=\"docutils literal notranslate\">0001</code>, as long as it’s unique for the given app name. Use the\nname <code class=\"docutils literal notranslate\">zero</code> to migrate all the way back i.e. to revert all applied\nmigrations for an app.</p></li>\n</ul>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</p>\n<p>When unapplying migrations, all dependent migrations will also be\nunapplied, regardless of <code class=\"docutils literal notranslate\">&lt;app_label&gt;</code>. You can use <code class=\"docutils literal notranslate\">--plan</code> to check\nwhich migrations will be unapplied.</p>\n</aside>\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=\"/es/6.0/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-plan\">\n<span class=\"sig-name descname\">--plan</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-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 operations that will be performed for the given <code class=\"docutils literal notranslate\">migrate</code>\ncommand.</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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-check\">\n<span class=\"sig-name descname\">--check</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-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\">migrate</code> exit with a non-zero status when unapplied migrations are\ndetected.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-prune\">\n<span class=\"sig-name descname\">--prune</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-migrate-prune\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Deletes nonexistent migrations from the <code class=\"docutils literal notranslate\">django_migrations</code> table. This is\nuseful when migration files replaced by a squashed migration have been removed.\nSee <a class=\"reference internal\" href=\"/es/6.0/topics/migrations/#migration-squashing\"><span class=\"std std-ref\">Squashing migrations</span></a> for more details.</p>\n</section>\n<section id=\"optimizemigration\">\n<h3><code class=\"docutils literal notranslate\">optimizemigration</code><a class=\"heading-anchor\" href=\"#optimizemigration\"><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-optimizemigration\">\n<span class=\"sig-name descname\">django-admin optimizemigration app_label migration_name</span><a class=\"heading-anchor\" href=\"#django-admin-optimizemigration\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Optimizes the operations for the named migration and overrides the existing\nfile. If the migration contains functions that must be manually copied, the\ncommand creates a new migration file suffixed with <code class=\"docutils literal notranslate\">_optimized</code> that is meant\nto replace the named migration.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-optimizemigration-check\">\n<span class=\"sig-name descname\">--check</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-optimizemigration-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\">optimizemigration</code> exit with a non-zero status when a migration can be\noptimized.</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\nan IP 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=\"/es/6.0/ref/settings/#std-setting-WSGI_APPLICATION\"><code class=\"xref std std-setting docutils literal notranslate\">WSGI_APPLICATION</code></a> setting.</p>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</p>\n<p>DO NOT USE THIS SERVER IN A PRODUCTION SETTING.</p>\n<p>This lightweight development server has not gone through security audits or\nperformance tests, hence is unsuitable for production. Making this server\nable to handle a production environment is outside the scope of Django.</p>\n</aside>\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’re using Linux or MacOS and install both <a class=\"extlink-pypi reference external\" href=\"https://pypi.org/project/pywatchman/\">pywatchman</a> and the\n<a class=\"reference external\" href=\"https://facebook.github.io/watchman/\">Watchman</a> service, kernel signals will be used to autoreload the server\n(rather than polling file modification timestamps each second). This offers\nbetter performance on large projects, reduced response time after code changes,\nmore robust change detection, and a reduction in power usage. Django supports\n<code class=\"docutils literal notranslate\">pywatchman</code> 1.2.0 and higher.</p>\n<aside class=\"admonition-large-directories-with-many-files-may-cause-performance-issues admonition\" role=\"note\">\n<p class=\"admonition-title\">Large directories with many files may cause performance issues</p>\n<p>When using Watchman with a project that includes large non-Python\ndirectories like <code class=\"docutils literal notranslate\">node_modules</code>, it’s advisable to ignore this directory\nfor optimal performance. See the <a class=\"reference external\" href=\"https://facebook.github.io/watchman/docs/config#ignore_dirs\">watchman documentation</a> for information\non how to do this.</p>\n</aside>\n<aside class=\"admonition-watchman-timeout admonition\" role=\"note\">\n<p class=\"admonition-title\">Watchman timeout</p>\n<dl class=\"std envvar\">\n<dt class=\"sig sig-object std\" id=\"envvar-DJANGO_WATCHMAN_TIMEOUT\">\n<span class=\"sig-name descname\">DJANGO_WATCHMAN_TIMEOUT</span><a class=\"heading-anchor\" href=\"#envvar-DJANGO_WATCHMAN_TIMEOUT\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>The default timeout of <code class=\"docutils literal notranslate\">Watchman</code> client is 5 seconds. You can change it\nby setting the <span class=\"target\" id=\"index-4\"></span><a class=\"reference internal\" href=\"#envvar-DJANGO_WATCHMAN_TIMEOUT\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_WATCHMAN_TIMEOUT</code></a> environment variable.</p>\n</aside>\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. You can use the\n<code class=\"docutils literal notranslate\">--skip-checks</code> option to skip running system checks.</p>\n<p>You can run as many concurrent servers as you want, as long as they’re on\nseparate ports by executing <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>), <code class=\"docutils literal notranslate\">0</code>\n(shortcut for <code class=\"docutils literal notranslate\">0.0.0.0</code>), <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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/ref/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<dl class=\"std envvar\">\n<dt class=\"sig sig-object std\" id=\"envvar-DJANGO_RUNSERVER_HIDE_WARNING\">\n<span class=\"sig-name descname\">DJANGO_RUNSERVER_HIDE_WARNING</span><a class=\"heading-anchor\" href=\"#envvar-DJANGO_RUNSERVER_HIDE_WARNING\"><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=\"5.2\" role=\"note\">\n<p class=\"version-note-title\">New in Django 5.2</p></aside>\n<p>By default, a warning is printed to the console that <code class=\"docutils literal notranslate\">runserver</code> is not\nsuitable for production:</p>\n<div class=\"code-block\" data-language=\"text\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Text</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=\"Text code\"><code>WARNING: This is a development server. Do not use it in a production setting. Use a production WSGI or ASGI server instead.\nFor more information on production servers see: https://docs.djangoproject.com/en/|version|/howto/deployment/\n</code></pre></div>\n<p>Set this environment variable to <code class=\"docutils literal notranslate\">&quot;true&quot;</code> to hide this warning.</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=\"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=\"go\">django-admin runserver</span>\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=\"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=\"go\">django-admin runserver 1.2.3.4: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=\"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=\"go\">django-admin runserver 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=\"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=\"go\">django-admin runserver 1.2.3.4: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=\"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=\"go\">django-admin runserver -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=\"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=\"go\">django-admin runserver -6 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=\"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=\"go\">django-admin runserver [2001:0db8:1234:5678::9]: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=\"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=\"go\">django-admin runserver localhost: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=\"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=\"go\">django-admin runserver -6 localhost: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=\"/es/6.0/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=\"/es/6.0/howto/static-files/\"><span class=\"doc\">How to manage static files (e.g. images, JavaScript, CSS)</span></a>.</p>\n</section>\n<section id=\"serving-with-asgi-in-development\">\n<h4>Serving with ASGI in development<a class=\"heading-anchor\" href=\"#serving-with-asgi-in-development\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Django’s <code class=\"docutils literal notranslate\">runserver</code> command provides a WSGI server. In order to run under\nASGI you will need to use an <a class=\"reference internal\" href=\"/es/6.0/howto/deployment/asgi/\"><span class=\"doc\">ASGI server</span></a>.\nThe Django Daphne project provides <a class=\"reference internal\" href=\"/es/6.0/howto/deployment/asgi/daphne/#daphne-runserver\"><span class=\"std std-ref\">Integration with runserver</span></a> that you can use.</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=\"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=\"go\">django-admin sendtestemail foo@example.com bar@example.com</span>\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=\"/es/6.0/ref/settings/#std-setting-MANAGERS\"><code class=\"xref std std-setting docutils literal notranslate\">MANAGERS</code></a> using\n<a class=\"reference internal\" href=\"/es/6.0/topics/email/#django.core.mail.mail_managers\" title=\"django.core.mail.mail_managers\"><code class=\"xref py py-func 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=\"/es/6.0/ref/settings/#std-setting-ADMINS\"><code class=\"xref std std-setting docutils literal notranslate\">ADMINS</code></a> using\n<a class=\"reference internal\" href=\"/es/6.0/topics/email/#django.core.mail.mail_admins\" title=\"django.core.mail.mail_admins\"><code class=\"xref py py-func 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<p>All models from installed apps are automatically imported into the shell\nenvironment. Models from apps listed earlier in <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a> take\nprecedence. The following common utilities are also imported:</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</span> <span class=\"kn\">import</span> connection<span class=\"p\">,</span> reset_queries<span class=\"p\">,</span> models\n<span class=\"kn\">from</span> <span class=\"nn\">django.conf</span> <span class=\"kn\">import</span> settings\n<span class=\"kn\">from</span> <span class=\"nn\">django.utils</span> <span class=\"kn\">import</span> timezone\n</code></pre></div>\n<p>For a <code class=\"docutils literal notranslate\">--verbosity</code> of 2 or higher, the automatically imported objects will\nbe listed. To disable automatic importing entirely, use the <code class=\"docutils literal notranslate\">--no-imports</code>\nflag.</p>\n<p>See the guide on <a class=\"reference internal\" href=\"/es/6.0/howto/custom-shell/#customizing-shell-auto-imports\"><span class=\"std std-ref\">customizing this behavior</span></a> to add or remove automatic imports.</p>\n<aside class=\"version-note version-changed\" data-version=\"5.2\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 5.2</p><p>Automatic models import was added.</p>\n</aside>\n<aside class=\"version-note version-changed\" data-version=\"6.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 6.0</p><p>Automatic imports of common utilities, such as <code class=\"docutils literal notranslate\">django.conf.settings</code>,\nwere added.</p>\n</aside>\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=\"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=\"go\">django-admin shell -i ipython</span>\n</code></pre></div>\n<p>bpython:</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=\"go\">django-admin shell -i bpython</span>\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=\"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=\"go\">django-admin shell -i python</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-shell-no-startup\">\n<span class=\"sig-name descname\">--no-startup</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-shell-no-startup\"><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-5\"></span><a class=\"reference external\" href=\"https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP\" title=\"(en Python versión 3.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-no-imports\">\n<span class=\"sig-name descname\">--no-imports</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-shell-no-imports\"><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=\"5.2\" role=\"note\">\n<p class=\"version-note-title\">New in Django 5.2</p></aside>\n<p>Disables the automatic import of models from <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>.</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=\"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=\"go\">django-admin shell --command=&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=\"(en Python versión 3.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). For a <code class=\"docutils literal notranslate\">--verbosity</code> of 2 and above, the applied\ndatetimes are also shown.</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\n<code class=\"docutils literal notranslate\">migration_name</code> down into fewer migrations, if possible. The resulting\nsquashed migrations can live alongside the unsquashed ones safely. For more\ninformation, please read <a class=\"reference internal\" href=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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<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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-squashmigrations-no-header\">\n<span class=\"sig-name descname\">--no-header</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-squashmigrations-no-header\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Generate squashed migration file without Django version and timestamp header.</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, <a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/6.0.x/django/conf/app_template\">the new directory</a> contains a\n<code class=\"docutils literal notranslate\">models.py</code> file and other app template files. If only the app name is given,\nthe app directory will be created in the current working directory.</p>\n<p>If the optional destination is provided, Django will use that name instead. If\nthe directory with the given name doesn’t exist, it will be created. You can\nuse “.” to denote the current working directory.</p>\n<aside class=\"version-note version-changed\" data-version=\"6.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 6.0</p><p>Automatic creation of the destination directory was added.</p>\n</aside>\n<p>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=\"go\">django-admin startapp myapp /Users/jezdez/Code/myapp</span>\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\nan uncompressed archive (<code class=\"docutils literal notranslate\">.tar</code>) or a compressed archive (<code class=\"docutils literal notranslate\">.tar.gz</code>,\n<code class=\"docutils literal notranslate\">.tar.bz2</code>, <code class=\"docutils literal notranslate\">.tar.xz</code>, <code class=\"docutils literal notranslate\">.tar.lzma</code>, <code class=\"docutils literal notranslate\">.tgz</code>, <code class=\"docutils literal notranslate\">.tbz2</code>, <code class=\"docutils literal notranslate\">.txz</code>,\n<code class=\"docutils literal notranslate\">.tlz</code>, <code class=\"docutils literal notranslate\">.zip</code>) containing 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=\"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=\"go\">django-admin startapp --template=/Users/jezdez/Code/my_app_template myapp</span>\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=\"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=\"go\">django-admin startapp --template=https://github.com/githubuser/django-app-template/archive/main.zip myapp</span>\n</code></pre></div>\n<aside class=\"admonition admonition-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</p>\n<p>Templates provided via <code class=\"docutils literal notranslate\">--template</code> are used as is. Malicious or poorly\nconstructed templates may introduce security weaknesses or unintended\nbehavior. Compressed archives may also consume excessive resources during\nextraction, potentially causing crashes or hangs.</p>\n<p>Contents of templates should be carefully inspected before use.</p>\n</aside>\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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startapp-exclude\">\n<span id=\"cmdoption-startapp-x\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> DIRECTORIES</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-x</span><span class=\"sig-prename descclassname\"> DIRECTORIES</span><a class=\"heading-anchor\" href=\"#cmdoption-startapp-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 which directories in the app template should be excluded, in addition\nto <code class=\"docutils literal notranslate\">.git</code> and <code class=\"docutils literal notranslate\">__pycache__</code>. If this option is not provided, directories\nnamed <code class=\"docutils literal notranslate\">__pycache__</code> or starting with <code class=\"docutils literal notranslate\">.</code> will be excluded.</p>\n<p>The <a class=\"reference internal\" href=\"/es/6.0/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. <code class=\"docutils literal notranslate\">'2.0.3'</code></p></li>\n</ul>\n<aside class=\"admonition admonition-warning\" id=\"render-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</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=\"/es/6.0/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<aside class=\"admonition admonition-warning\" id=\"trusted-code-warning\" role=\"note\">\n<p class=\"admonition-title\">Advertencia</p>\n<p>The contents of custom app (or project) templates should always be\naudited before use: Such templates define code that will become\npart of your project, and this means that such code will be trusted\nas much as any app you install, or code you write yourself.\nFurther, even rendering the templates is, effectively, executing\ncode that was provided as input to the management command. The\nDjango template language may provide wide access into the system,\nso make sure any custom template you use is worthy of your trust.</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, <a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/6.0.x/django/conf/project_template\">the new directory</a> contains\n<code class=\"docutils literal notranslate\">manage.py</code> and a project package (containing a <code class=\"docutils literal notranslate\">settings.py</code> and other\nfiles).</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 name as the\nproject directory, and create <code class=\"docutils literal notranslate\">manage.py</code> and the project package within it.\nIf the directory with the given name doesn’t exist, it will be created. Use “.”\nto denote the current working directory.</p>\n<aside class=\"version-note version-changed\" data-version=\"6.0\" role=\"note\">\n<p class=\"version-note-title\">Changed in Django 6.0</p><p>Automatic creation of the destination directory was added.</p>\n</aside>\n<p>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=\"go\">django-admin startproject myproject /Users/jezdez/Code/myproject_repo</span>\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. The same\n<strong>security considerations</strong> described for <code class=\"docutils literal notranslate\">startapp</code> templates apply here:\nmalicious or poorly constructed templates may introduce weaknesses or consume\nexcessive resources, and templates should be carefully inspected before use.</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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-startproject-exclude\">\n<span id=\"cmdoption-startproject-x\"></span><span class=\"sig-name descname\">--exclude</span><span class=\"sig-prename descclassname\"> DIRECTORIES</span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-x</span><span class=\"sig-prename descclassname\"> DIRECTORIES</span><a class=\"heading-anchor\" href=\"#cmdoption-startproject-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 which directories in the project template should be excluded, in\naddition to <code class=\"docutils literal notranslate\">.git</code> and <code class=\"docutils literal notranslate\">__pycache__</code>. If this option is not provided,\ndirectories named <code class=\"docutils literal notranslate\">__pycache__</code> or starting with <code class=\"docutils literal notranslate\">.</code> will be excluded.</p>\n<p>The <a class=\"reference internal\" href=\"/es/6.0/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=\"/es/6.0/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. <code class=\"docutils literal notranslate\">'2.0.3'</code></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> and\n<a class=\"reference internal\" href=\"#trusted-code-warning\"><span class=\"std std-ref\">trusted code warning</span></a> as mentioned for\n<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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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 class=\"sig-name descname\">--keepdb</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. Unless the <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-TEST_MIGRATE\"><code class=\"xref std std-setting docutils literal notranslate\">MIGRATE</code></a> test setting is\n<code class=\"docutils literal notranslate\">False</code>, any unapplied migrations will also be applied to the test database\nbefore running the test suite.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-shuffle\">\n<span class=\"sig-name descname\">--shuffle</span><span class=\"sig-prename descclassname\"> [SEED]</span><a class=\"heading-anchor\" href=\"#cmdoption-test-shuffle\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Randomizes the order of tests before running them. This can help detect tests\nthat aren’t properly isolated. The test order generated by this option is a\ndeterministic function of the integer seed given. When no seed is passed, a\nseed is chosen randomly and printed to the console. To repeat a particular test\norder, pass a seed. The test orders generated by this option preserve Django’s\n<a class=\"reference internal\" href=\"/es/6.0/topics/testing/overview/#order-of-tests\"><span class=\"std std-ref\">guarantees on test order</span></a>. They also keep tests grouped\nby test case class.</p>\n<p>The shuffled orderings also have a special consistency property useful when\nnarrowing down isolation issues. Namely, for a given seed and when running a\nsubset of tests, the new order will be the original shuffling restricted to the\nsmaller set. Similarly, when adding tests while keeping the seed the same, the\norder of the original tests will be the same in the new order.</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=\"/es/6.0/topics/testing/overview/#order-of-tests\"><span class=\"std std-ref\">Grouping by test\nclass</span></a> is preserved when using this option. This can be used\nin conjunction with <code class=\"docutils literal notranslate\">--shuffle</code> to reverse the order for a particular seed.</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=\"/es/6.0/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=\"/es/6.0/ref/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<dl class=\"std envvar\">\n<dt class=\"sig sig-object std\" id=\"envvar-DJANGO_TEST_PROCESSES\">\n<span class=\"sig-name descname\">DJANGO_TEST_PROCESSES</span><a class=\"heading-anchor\" href=\"#envvar-DJANGO_TEST_PROCESSES\"><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>Using <code class=\"docutils literal notranslate\">--parallel</code> without a value, or with the value <code class=\"docutils literal notranslate\">auto</code>, runs one test\nprocess per core according to <a class=\"reference external\" href=\"https://docs.python.org/3/library/multiprocessing.html#multiprocessing.cpu_count\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\">multiprocessing.cpu_count()</code></a>. You can\noverride this by passing the desired number of processes, e.g.\n<code class=\"docutils literal notranslate\">--parallel 4</code>, or by setting the <span class=\"target\" id=\"index-6\"></span><a class=\"reference internal\" href=\"#envvar-DJANGO_TEST_PROCESSES\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_TEST_PROCESSES</code></a> environment\nvariable.</p>\n<p>Django distributes test cases — <a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#unittest.TestCase\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-class docutils literal notranslate\">unittest.TestCase</code></a> subclasses — to\nsubprocesses. If there are fewer test case classes than configured processes,\nDjango will reduce the number of processes accordingly.</p>\n<p>Each process gets its own database. You must ensure that different test case\nclasses don’t access the same resources. For instance, test case classes that\ntouch the filesystem should create a temporary directory for their own use.</p>\n<aside class=\"admonition admonition-note\" role=\"note\">\n<p class=\"admonition-title\">Nota</p>\n<p>If you have test classes that cannot be run in parallel, you can use\n<code class=\"docutils literal notranslate\">SerializeMixin</code> to run them sequentially. See <a class=\"reference internal\" href=\"/es/6.0/topics/testing/advanced/#topics-testing-enforce-run-sequentially\"><span class=\"std std-ref\">Enforce running test\nclasses sequentially</span></a>.</p>\n</aside>\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>python -m 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=\"(en Python versión 3.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\">Advertencia</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=\"(en Python versión 3.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=\"/es/6.0/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<p>Tests that fail to load are always considered matching.</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=\"/es/6.0/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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-k\">\n<span class=\"sig-name descname\">-k</span><span class=\"sig-prename descclassname\"> TEST_NAME_PATTERNS</span><a class=\"heading-anchor\" href=\"#cmdoption-test-k\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Runs test methods and classes matching test name patterns, in the same way as\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#cmdoption-unittest-k\" title=\"(en Python versión 3.14)\"><code class=\"xref std std-option docutils literal notranslate\">unittest's -k option</code></a>. Can be specified multiple times.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-pdb\">\n<span class=\"sig-name descname\">--pdb</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-pdb\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Spawns a <code class=\"docutils literal notranslate\">pdb</code> debugger at each test error or failure. If you have it\ninstalled, <code class=\"docutils literal notranslate\">ipdb</code> is used instead.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-buffer\">\n<span id=\"cmdoption-test-b\"></span><span class=\"sig-name descname\">--buffer</span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\">, </span><span class=\"sig-name descname\">-b</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-buffer\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Discards output (<code class=\"docutils literal notranslate\">stdout</code> and <code class=\"docutils literal notranslate\">stderr</code>) for passing tests, in the same way\nas <a class=\"reference external\" href=\"https://docs.python.org/3/library/unittest.html#cmdoption-unittest-b\" title=\"(en Python versión 3.14)\"><code class=\"xref std std-option docutils literal notranslate\">unittest's --buffer option</code></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-no-faulthandler\">\n<span class=\"sig-name descname\">--no-faulthandler</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-no-faulthandler\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Django automatically calls <a class=\"reference external\" href=\"https://docs.python.org/3/library/faulthandler.html#faulthandler.enable\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-func docutils literal notranslate\">faulthandler.enable()</code></a> when starting the\ntests, which allows it to print a traceback if the interpreter crashes. Pass\n<code class=\"docutils literal notranslate\">--no-faulthandler</code> to disable this behavior.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-timing\">\n<span class=\"sig-name descname\">--timing</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-timing\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Outputs timings, including database setup and total run time.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-durations\">\n<span class=\"sig-name descname\">--durations</span><span class=\"sig-prename descclassname\"> N</span><a class=\"heading-anchor\" href=\"#cmdoption-test-durations\"><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 N slowest test cases (N=0 for all).</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=\"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=\"go\">django-admin testserver mydata.json</span>\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=\"/es/6.0/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=\"/es/6.0/topics/testing/overview/\"><span class=\"doc\">unit tests</span></a> of how your\nviews act with certain fixture data, you can use <code class=\"docutils literal notranslate\">testserver</code> to interact\nwith the 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 <a class=\"reference internal\" href=\"/es/6.0/topics/db/fixtures/#fixtures-explanation\"><span class=\"std std-ref\">fixture</span></a> (using the\n<a class=\"reference internal\" href=\"#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\">dumpdata</code></a> command, explained above), then use <code class=\"docutils literal notranslate\">testserver</code> to run\nyour web application with that data. With this arrangement, you have the\nflexibility of messing up your data in any way, knowing that whatever data\nchanges you’re making are only being 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=\"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=\"go\">django-admin testserver --addrport 7000 fixture1 fixture2</span>\n<span class=\"go\">django-admin testserver fixture1 fixture2 --addrport 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=\"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=\"go\">django-admin testserver --addrport 1.2.3.4:7000 test</span>\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=\"/es/6.0/howto/custom-management-commands/\"><span class=\"doc\">implements</span></a> them has been\n<a class=\"reference internal\" href=\"/es/6.0/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=\"/es/6.0/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=\"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=\"go\">django-admin changepassword ringo</span>\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<dl class=\"std envvar\">\n<dt class=\"sig sig-object std\" id=\"envvar-DJANGO_SUPERUSER_PASSWORD\">\n<span class=\"sig-name descname\">DJANGO_SUPERUSER_PASSWORD</span><a class=\"heading-anchor\" href=\"#envvar-DJANGO_SUPERUSER_PASSWORD\"><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=\"/es/6.0/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, you can provide\na password by setting the <span class=\"target\" id=\"index-7\"></span><a class=\"reference internal\" href=\"#envvar-DJANGO_SUPERUSER_PASSWORD\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SUPERUSER_PASSWORD</code></a> environment\nvariable. Otherwise, no password will be set, and the superuser account will\nnot be able to log in until a password has been manually set for it.</p>\n<p>In non-interactive mode, the\n<a class=\"reference internal\" href=\"/es/6.0/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD\" title=\"django.contrib.auth.models.CustomUser.USERNAME_FIELD\"><code class=\"xref py py-attr docutils literal notranslate\">USERNAME_FIELD</code></a> and required\nfields (listed in\n<a class=\"reference internal\" href=\"/es/6.0/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>) fall back to\n<code class=\"docutils literal notranslate\">DJANGO_SUPERUSER_&lt;uppercase_field_name&gt;</code> environment variables, unless they\nare overridden by a command line argument. For example, to provide an <code class=\"docutils literal notranslate\">email</code>\nfield, you can use <code class=\"docutils literal notranslate\">DJANGO_SUPERUSER_EMAIL</code> environment variable.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createsuperuser-noinput\">\n<span id=\"cmdoption-createsuperuser-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-createsuperuser-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 1.</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\nyou want to customize data input and validation. Consult the source code for\ndetails on the existing implementation and the method’s parameters. For\nexample, it could be useful if you have a <code class=\"docutils literal notranslate\">ForeignKey</code> in\n<a class=\"reference internal\" href=\"/es/6.0/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=\"/es/6.0/ref/contrib/contenttypes/\"><span class=\"doc\">contenttypes app</span></a> (<a class=\"reference internal\" href=\"/es/6.0/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<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-remove_stale_contenttypes-include-stale-apps\">\n<span class=\"sig-name descname\">--include-stale-apps</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-remove_stale_contenttypes-include-stale-apps\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Deletes stale content types including ones from previously installed apps that\nhave been removed from <a class=\"reference internal\" href=\"/es/6.0/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\">INSTALLED_APPS</code></a>. Defaults to <code class=\"docutils literal notranslate\">False</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=\"/es/6.0/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=\"/es/6.0/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-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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/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=\"/es/6.0/ref/contrib/staticfiles/#django-admin-findstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\">description</code></a> in the\n<a class=\"reference internal\" href=\"/es/6.0/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 by default:</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://docs.python.org/3/library/sys.html#sys.path\" title=\"(en Python versión 3.14)\"><code class=\"xref py py-data docutils literal notranslate\">sys.path</code></a> module\nattribute. If this isn’t provided, <code class=\"docutils literal notranslate\">django-admin</code> will use the\n<span class=\"target\" id=\"index-8\"></span><a class=\"reference external\" href=\"https://docs.python.org/3/using/cmdline.html#envvar-PYTHONPATH\" title=\"(en Python versión 3.14)\"><code class=\"xref std std-envvar docutils literal notranslate\">PYTHONPATH</code></a> environment variable.</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=\"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=\"go\">django-admin migrate --pythonpath=&#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 <span class=\"target\" id=\"index-9\"></span><a class=\"reference internal\" href=\"/es/6.0/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_SETTINGS_MODULE</code></a> environment\nvariable.</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=\"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=\"go\">django-admin migrate --settings=mysite.settings</span>\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=\"/es/6.0/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 an 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>This option is ignored by <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a>.</p>\n<p>Example usage:</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=\"go\">django-admin migrate --traceback</span>\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>This option is ignored by <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\">runserver</code></a>.</p>\n<p>Example usage:</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=\"go\">django-admin migrate --verbosity 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=\"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=\"go\">django-admin runserver --no-color</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-force-color\">\n<span class=\"sig-name descname\">--force-color</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-force-color\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Forces colorization of the command output if it would otherwise be disabled\nas discussed in <a class=\"reference internal\" href=\"#syntax-coloring\"><span class=\"std std-ref\">Syntax coloring</span></a>. For example, you may want to pipe\ncolored output to another command.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-skip-checks\">\n<span class=\"sig-name descname\">--skip-checks</span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-skip-checks\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Skips running system checks prior to running the command. This option is only\navailable if the\n<a class=\"reference internal\" href=\"/es/6.0/howto/custom-management-commands/#django.core.management.BaseCommand.requires_system_checks\" title=\"django.core.management.BaseCommand.requires_system_checks\"><code class=\"xref py py-attr docutils literal notranslate\">requires_system_checks</code></a> command\nattribute is not an empty list or tuple.</p>\n<p>Example usage:</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=\"go\">django-admin migrate --skip-checks</span>\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<dl class=\"std envvar\">\n<dt class=\"sig sig-object std\" id=\"envvar-DJANGO_COLORS\">\n<span class=\"sig-name descname\">DJANGO_COLORS</span><a class=\"heading-anchor\" href=\"#envvar-DJANGO_COLORS\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\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 unless the <a class=\"reference internal\" href=\"#cmdoption-force-color\"><code class=\"xref std std-option docutils literal notranslate\">--force-color</code></a> option is used.</p>\n<section id=\"windows-support\">\n<h4>Windows support<a class=\"heading-anchor\" href=\"#windows-support\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>On Windows 10, the <a class=\"reference external\" href=\"https://www.microsoft.com/en-us/p/windows-terminal-preview/9n0dx20hk701\">Windows Terminal</a> application, <a class=\"reference external\" href=\"https://code.visualstudio.com\">VS Code</a>, and PowerShell\n(where virtual terminal processing is enabled) allow colored output, and are\nsupported by default.</p>\n<p>Under Windows, the legacy <code class=\"docutils literal notranslate\">cmd.exe</code> native console doesn’t support ANSI\nescape sequences so by default there is no color output. In this case either of\ntwo third-party libraries are needed:</p>\n<ul>\n<li><p>Install <a class=\"extlink-pypi reference external\" href=\"https://pypi.org/project/colorama/\">colorama</a>, a Python package that translates ANSI color codes\ninto Windows API calls. Django commands will detect its presence and will\nmake use of its services to color output just like on Unix-based platforms.\n<code class=\"docutils literal notranslate\">colorama</code> can be installed via pip:</p>\n<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 code\"><code><span class=\"gp\">...\\&gt;</span> py -m pip install <span class=\"s2\">&quot;colorama &gt;= 0.4.6&quot;</span>\n</code></pre></div>\n</li>\n<li><p>Install <a class=\"reference external\" href=\"http://adoxa.altervista.org/ansicon/\">ANSICON</a>, a third-party tool that allows <code class=\"docutils literal notranslate\">cmd.exe</code> to process\nANSI color codes. Django commands will detect its presence and will make use\nof its services to color output just like on Unix-based platforms.</p></li>\n</ul>\n<p>Other modern terminal environments on Windows, that support terminal colors,\nbut which are not automatically detected as supported by Django, may «fake» the\ninstallation of <code class=\"docutils literal notranslate\">ANSICON</code> by setting the appropriate environmental variable,\n<code class=\"docutils literal notranslate\">ANSICON=&quot;on&quot;</code>.</p>\n</section>\n<section id=\"custom-colors\">\n<h4>Custom colors<a class=\"heading-anchor\" href=\"#custom-colors\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\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 <span class=\"target\" id=\"index-10\"></span><a class=\"reference internal\" href=\"#envvar-DJANGO_COLORS\"><code class=\"xref std std-envvar docutils literal notranslate\">DJANGO_COLORS</code></a> 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=\"shell\"><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=\"nb\">export</span> <span class=\"nv\">DJANGO_COLORS</span><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=\"shell\"><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=\"nb\">export</span> <span class=\"nv\">DJANGO_COLORS</span><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=\"shell\"><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=\"nb\">export</span> <span class=\"nv\">DJANGO_COLORS</span><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>\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 <a class=\"extlink-source reference external\" href=\"https://github.com/django/django/blob/stable/6.0.x/extras/django_bash_completion\">extras/django_bash_completion</a> in the Django\nsource distribution. 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=\"/es/6.0/howto/custom-management-commands/\"><span class=\"doc\">How to create custom django-admin commands</span></a> for how to add customized actions.</p>\n</section>\n<section id=\"black-formatting\">\n<h3>Black formatting<a class=\"heading-anchor\" href=\"#black-formatting\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The Python files created by <a class=\"reference internal\" href=\"#django-admin-startproject\"><code class=\"xref std std-djadmin docutils literal notranslate\">startproject</code></a>, <a class=\"reference internal\" href=\"#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\">startapp</code></a>,\n<a class=\"reference internal\" href=\"#django-admin-optimizemigration\"><code class=\"xref std std-djadmin docutils literal notranslate\">optimizemigration</code></a>, <a class=\"reference internal\" href=\"#django-admin-makemigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">makemigrations</code></a>, and\n<a class=\"reference internal\" href=\"#django-admin-squashmigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\">squashmigrations</code></a> are formatted using the <code class=\"docutils literal notranslate\">black</code> command if it is\npresent on your <code class=\"docutils literal notranslate\">PATH</code>.</p>\n<p>If you have <code class=\"docutils literal notranslate\">black</code> globally installed, but do not wish it used for the\ncurrent project, you can set the <code class=\"docutils literal notranslate\">PATH</code> explicitly:</p>\n<div class=\"code-block\" data-language=\"shell\"><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=\"nv\">PATH</span><span class=\"o\">=</span>path/to/venv/bin django-admin makemigrations\n</code></pre></div>\n<p>For commands using <code class=\"docutils literal notranslate\">stdout</code> you can pipe the output to <code class=\"docutils literal notranslate\">black</code> if needed:</p>\n<div class=\"code-block\" data-language=\"shell\"><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>django-admin inspectdb <span class=\"p\">|</span> black -\n</code></pre></div>\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=\"s2\">&quot;flush&quot;</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=\"s2\">&quot;loaddata&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;test_data&quot;</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=\"s2\">&quot;test_data&quot;</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\nabove.</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=\"s2\">&quot;dumpdata&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;--natural-foreign&quot;</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=\"s2\">&quot;dumpdata&quot;</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=\"s2\">&quot;dumpdata&quot;</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=\"s2\">&quot;dumpdata&quot;</span><span class=\"p\">,</span> exclude<span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s2\">&quot;contenttypes&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;auth&quot;</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=\"s2\">&quot;/path/to/command_output&quot;</span><span class=\"p\">,</span> <span class=\"s2\">&quot;w&quot;</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=\"s2\">&quot;dumpdata&quot;</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":"Fixtures compression","anchor":"fixtures-compression","children":[]}]},{"title":"flush","anchor":"flush","children":[]},{"title":"inspectdb","anchor":"inspectdb","children":[{"title":"Database-specific notes","anchor":"database-specific-notes","children":[{"title":"Oracle","anchor":"oracle","children":[]},{"title":"PostgreSQL","anchor":"postgresql","children":[]}]}]},{"title":"loaddata","anchor":"loaddata","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":"optimizemigration","anchor":"optimizemigration","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":"Serving with ASGI in development","anchor":"serving-with-asgi-in-development","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.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":"Windows support","anchor":"windows-support","children":[]},{"title":"Custom colors","anchor":"custom-colors","children":[]}]},{"title":"Bash completion","anchor":"bash-completion","children":[]},{"title":"Black formatting","anchor":"black-formatting","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":"/es/6.0/ref/"}],"prev":{"docname":"ref/databases","title":"Databases","url":"/es/6.0/ref/databases/"},"next":{"docname":"ref/exceptions","title":"Django Exceptions","url":"/es/6.0/ref/exceptions/"},"formats":{"html":"/es/6.0/ref/django-admin/","markdown":"/es/6.0/ref/django-admin.md","json":"/es/6.0/ref/django-admin.json"},"source":"https://github.com/django/django/blob/stable/6.0.x/docs/ref/django-admin.txt","official":"https://docs.djangoproject.com/es/6.0/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","1.9"],"inLocales":["en","sv","zh-hans","ga","fr","ja","id","it","pt-br","ko","es","el","pl"]}