{"title":"django-admin and manage.py","version":"1.8","locale":"en","docname":"ref/django-admin","url":"/en/1.8/ref/django-admin/","canonical":"https://djangodocs.dev/en/1.8/ref/django-admin/","summary":"django-admin is Django’s command-line utility for administrative tasks. This document outlines all it can do. Changed in Django 1.7 Prior to Django 1.7,…","html":"<section id=\"django-admin-and-manage-py\">\n<h1>django-admin and manage.py<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\"><span class=\"pre\">django-admin</span></code> is Django’s command-line utility for administrative tasks.\nThis document outlines all it can do.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>Prior to Django 1.7, <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> was only installed as\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin.py</span></code>.</p>\n</aside>\n<p>In addition, <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> is automatically created in each Django project.\n<code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> does the same thing as <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> but takes care of a few\nthings for you:</p>\n<ul class=\"simple\">\n<li><p>It puts your project’s package on <code class=\"docutils literal notranslate\"><span class=\"pre\">sys.path</span></code>.</p></li>\n<li><p>It sets the <span class=\"target\" id=\"index-0\"></span><a class=\"reference internal\" href=\"/en/1.8/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\"><span class=\"pre\">DJANGO_SETTINGS_MODULE</span></code></a> environment variable so that\nit points to your project’s <code class=\"docutils literal notranslate\"><span class=\"pre\">settings.py</span></code> file.</p></li>\n</ul>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> script should be on your system path if you installed\nDjango via its <code class=\"docutils literal notranslate\"><span class=\"pre\">setup.py</span></code> utility. If it’s not on your path, you can find it\nin <code class=\"docutils literal notranslate\"><span class=\"pre\">site-packages/django/bin</span></code> within your Python installation. Consider\nsymlinking it from some place on your path, such as <code class=\"docutils literal notranslate\"><span class=\"pre\">/usr/local/bin</span></code>.</p>\n<p>For Windows users, who do not have symlinking functionality available, you can\ncopy <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin.exe</span></code> to a location on your existing path or edit the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code> settings (under <code class=\"docutils literal notranslate\"><span class=\"pre\">Settings</span> <span class=\"pre\">-</span> <span class=\"pre\">Control</span> <span class=\"pre\">Panel</span> <span class=\"pre\">-</span> <span class=\"pre\">System</span> <span class=\"pre\">-</span> <span class=\"pre\">Advanced</span> <span class=\"pre\">-</span>\n<span class=\"pre\">Environment...</span></code>) to point to its installed location.</p>\n<p>Generally, when working on a single Django project, it’s easier to use\n<code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> than <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>. If you need to switch between multiple\nDjango settings files, use <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> with\n<span class=\"target\" id=\"index-1\"></span><a class=\"reference internal\" href=\"/en/1.8/topics/settings/#envvar-DJANGO_SETTINGS_MODULE\"><code class=\"xref std std-envvar docutils literal notranslate\"><span class=\"pre\">DJANGO_SETTINGS_MODULE</span></code></a> or the <code class=\"docutils literal notranslate\"><span class=\"pre\">--settings</span></code> command line\noption.</p>\n<p>The command-line examples throughout this document use <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> to\nbe consistent, but any example can use <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> just 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=\"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<span class=\"w\"> </span>&lt;command&gt;<span class=\"w\"> </span><span class=\"o\">[</span>options<span class=\"o\">]</span>\n<span class=\"gp\">$ </span>manage.py<span class=\"w\"> </span>&lt;command&gt;<span class=\"w\"> </span><span class=\"o\">[</span>options<span class=\"o\">]</span>\n</code></pre></div>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">command</span></code> should be one of the commands listed in this document.\n<code class=\"docutils literal notranslate\"><span class=\"pre\">options</span></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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">help</span></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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">help</span></code> to display usage information and a list of the\ncommands provided by each application.</p>\n<p>Run <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span> <span class=\"pre\">help</span> <span class=\"pre\">--commands</span></code> to display a list of all available\ncommands.</p>\n<p>Run <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span> <span class=\"pre\">help</span> <span class=\"pre\">&lt;command&gt;</span></code> to display a description of the given\ncommand and a list of its available options.</p>\n</section>\n<section id=\"app-names\">\n<h3>App names<a class=\"heading-anchor\" href=\"#app-names\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Many commands take a list of “app names.” An “app name” is the basename of\nthe package containing your models. For example, if your <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></code></a>\ncontains the string <code class=\"docutils literal notranslate\"><span class=\"pre\">'mysite.blog'</span></code>, the app name is <code class=\"docutils literal notranslate\"><span class=\"pre\">blog</span></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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">version</span></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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">version</span></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-0386/\"><strong>PEP 386</strong></a>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"mf\">1.4</span><span class=\"o\">.</span><span class=\"n\">dev17026</span>\n<span class=\"mf\">1.4</span><span class=\"n\">a1</span>\n<span class=\"mf\">1.4</span>\n</code></pre></div>\n</section>\n<section id=\"displaying-debug-output\">\n<h3>Displaying debug output<a class=\"heading-anchor\" href=\"#displaying-debug-output\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>Use <code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span></code> to specify the amount of notification and debug information\nthat <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> should print to the console. For more details, see the\ndocumentation for the <code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span></code> option.</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-appname-appname\">\n<h3>check &lt;appname appname …&gt;<a class=\"heading-anchor\" href=\"#check-appname-appname\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">check</span></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<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p></aside>\n<p>Uses the <a class=\"reference internal\" href=\"/en/1.8/ref/checks/\"><span class=\"doc\">system check framework</span></a> to inspect\nthe entire Django project for common problems.</p>\n<p>The system check framework will confirm that there aren’t any problems with\nyour installed models or your admin registrations. It will also provide warnings\nof common compatibility problems introduced by upgrading Django to a new version.\nCustom checks may be introduced by other libraries and applications.</p>\n<p>By default, all apps will be checked. You can check a subset of apps by providing\na list of app labels as arguments:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">python</span> <span class=\"n\">manage</span><span class=\"o\">.</span><span class=\"n\">py</span> <span class=\"n\">check</span> <span class=\"n\">auth</span> <span class=\"n\">admin</span> <span class=\"n\">myapp</span>\n</code></pre></div>\n<p>If you do not specify any app, all apps will be checked.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-tag\">\n<span class=\"sig-name descname\"><span class=\"pre\">--tag</span></span><span class=\"sig-prename descclassname\"> <span class=\"pre\">&lt;tagname&gt;</span></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 <a class=\"reference internal\" href=\"/en/1.8/ref/checks/\"><span class=\"doc\">system check framework</span></a> performs many different\ntypes of checks. These check types are categorized with tags. You can use these tags\nto restrict the checks performed to just those in a particular category. For example,\nto perform only security and compatibility checks, you would run:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">python</span> <span class=\"n\">manage</span><span class=\"o\">.</span><span class=\"n\">py</span> <span class=\"n\">check</span> <span class=\"o\">--</span><span class=\"n\">tag</span> <span class=\"n\">security</span> <span class=\"o\">--</span><span class=\"n\">tag</span> <span class=\"n\">compatibility</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-check-list-tags\">\n<span class=\"sig-name descname\"><span class=\"pre\">--list-tags</span></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>List 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\"><span class=\"pre\">--deploy</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--deploy</span></code> option activates some additional checks that are only relevant\nin a deployment setting.</p>\n<p>You can use this option in your local development environment, but since your\nlocal development settings module may not have many of your production settings,\nyou will probably want to point the <code class=\"docutils literal notranslate\"><span class=\"pre\">check</span></code> command at a different settings\nmodule, either by setting the <code class=\"docutils literal notranslate\"><span class=\"pre\">DJANGO_SETTINGS_MODULE</span></code> environment variable,\nor by passing the <code class=\"docutils literal notranslate\"><span class=\"pre\">--settings</span></code> option:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">python</span> <span class=\"n\">manage</span><span class=\"o\">.</span><span class=\"n\">py</span> <span class=\"n\">check</span> <span class=\"o\">--</span><span class=\"n\">deploy</span> <span class=\"o\">--</span><span class=\"n\">settings</span><span class=\"o\">=</span><span class=\"n\">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\"><span class=\"pre\">--settings</span></code>). You could even\nmake it part of your integration test suite.</p>\n</section>\n<section id=\"compilemessages\">\n<h3>compilemessages<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">compilemessages</span></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 .po files created by <a class=\"reference internal\" href=\"#django-admin-makemessages\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">makemessages</span></code></a> to .mo files for use with\nthe builtin gettext support. See <a class=\"reference internal\" href=\"/en/1.8/topics/i18n/\"><span class=\"doc\">Internationalization and localization</span></a>.</p>\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--locale</span></code> option (or its shorter version <code class=\"docutils literal notranslate\"><span class=\"pre\">-l</span></code>) to\nspecify the locale(s) to process. If not provided, all locales are processed.</p>\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--exclude</span></code> option (or its shorter version <code class=\"docutils literal notranslate\"><span class=\"pre\">-x</span></code>) to\nspecify the locale(s) to exclude from processing. If not provided, no locales\nare excluded.</p>\n<p>You can pass <code class=\"docutils literal notranslate\"><span class=\"pre\">--use-fuzzy</span></code> option (or <code class=\"docutils literal notranslate\"><span class=\"pre\">-f</span></code>) to include fuzzy translations\ninto compiled files.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.8\">\n<p class=\"version-note-title\">Changed in Django 1.8</p><p>Added <code class=\"docutils literal notranslate\"><span class=\"pre\">--exclude</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">--use-fuzzy</span></code> options.</p>\n</aside>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">fr</span> <span class=\"o\">-</span><span class=\"n\">f</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">pt_BR</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">fr</span> <span class=\"o\">--</span><span class=\"n\">use</span><span class=\"o\">-</span><span class=\"n\">fuzzy</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">fr</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">compilemessages</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">pt_BR</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">fr</span>\n</code></pre></div>\n</section>\n<section id=\"createcachetable\">\n<h3>createcachetable<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">createcachetable</span></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. See\n<a class=\"reference internal\" href=\"/en/1.8/topics/cache/\"><span class=\"doc\">Django’s cache framework</span></a> for more information.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database\nonto which the cachetable will be installed.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>It is no longer necessary to provide the cache table name or the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option. Django takes this information from your\nsettings file. If you have configured multiple caches or multiple databases,\nall cache tables are created.</p>\n</aside>\n</section>\n<section id=\"dbshell\">\n<h3>dbshell<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">dbshell</span></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<code class=\"docutils literal notranslate\"><span class=\"pre\">ENGINE</span></code> setting, with the connection parameters specified in your\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-USER\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">USER</span></code></a>, <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-PASSWORD\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">PASSWORD</span></code></a>, etc., settings.</p>\n<ul class=\"simple\">\n<li><p>For PostgreSQL, this runs the <code class=\"docutils literal notranslate\"><span class=\"pre\">psql</span></code> command-line client.</p></li>\n<li><p>For MySQL, this runs the <code class=\"docutils literal notranslate\"><span class=\"pre\">mysql</span></code> command-line client.</p></li>\n<li><p>For SQLite, this runs the <code class=\"docutils literal notranslate\"><span class=\"pre\">sqlite3</span></code> command-line client.</p></li>\n<li><p>For Oracle, this runs the <code class=\"docutils literal notranslate\"><span class=\"pre\">sqlplus</span></code> command-line client.</p></li>\n</ul>\n<p>This command assumes the programs are on your <code class=\"docutils literal notranslate\"><span class=\"pre\">PATH</span></code> so that a simple call to\nthe program name (<code class=\"docutils literal notranslate\"><span class=\"pre\">psql</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">mysql</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">sqlite3</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">sqlplus</span></code>) will find the\nprogram in the right place. There’s no way to specify the location of the\nprogram manually.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database\nonto which to open a shell.</p>\n</section>\n<section id=\"diffsettings\">\n<h3>diffsettings<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">diffsettings</span></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.</p>\n<p>Settings that don’t appear in the defaults are followed by <code class=\"docutils literal notranslate\"><span class=\"pre\">&quot;###&quot;</span></code>. For\nexample, the default settings don’t define <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-ROOT_URLCONF\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">ROOT_URLCONF</span></code></a>, so\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-ROOT_URLCONF\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">ROOT_URLCONF</span></code></a> is followed by <code class=\"docutils literal notranslate\"><span class=\"pre\">&quot;###&quot;</span></code> in the output of\n<code class=\"docutils literal notranslate\"><span class=\"pre\">diffsettings</span></code>.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--all</span></code> option may be provided to display all settings, even\nif they have Django’s default value. Such settings are prefixed by <code class=\"docutils literal notranslate\"><span class=\"pre\">&quot;###&quot;</span></code>.</p>\n</section>\n<section id=\"dumpdata-app-label-app-label-app-label-model\">\n<h3>dumpdata &lt;app_label app_label app_label.Model …&gt;<a class=\"heading-anchor\" href=\"#dumpdata-app-label-app-label-app-label-model\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">dumpdata</span></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\"><span class=\"pre\">dumpdata</span></code> can be used as input for <a class=\"reference internal\" href=\"#django-admin-loaddata\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">loaddata</span></code></a>.</p>\n<p>Note that <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> uses the default manager on the model for selecting the\nrecords to dump. If you’re using a <a class=\"reference internal\" href=\"/en/1.8/topics/db/managers/#custom-managers\"><span class=\"std std-ref\">custom manager</span></a> as\nthe default manager and it filters some of the available records, not all of the\nobjects will be dumped.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--all</span></code> option may be provided to specify that\n<code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> should use Django’s base manager, dumping records which\nmight otherwise be filtered or 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\"><span class=\"pre\">--format</span></span><span class=\"sig-prename descclassname\"> <span class=\"pre\">&lt;fmt&gt;</span></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>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> will format its output in JSON, but you can use the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--format</span></code> option to specify another format. Currently supported formats\nare listed in <a class=\"reference internal\" href=\"/en/1.8/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\"><span class=\"pre\">--indent</span></span><span class=\"sig-prename descclassname\"> <span class=\"pre\">&lt;num&gt;</span></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>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> will output all data on a single line. This isn’t\neasy for humans to read, so you can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--indent</span></code> option to\npretty-print the output with a number of indentation spaces.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--exclude</span></code> option may be provided to prevent specific\napplications or models (specified as in the form of <code class=\"docutils literal notranslate\"><span class=\"pre\">app_label.ModelName</span></code>)\nfrom being dumped. If you specify a model name to <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code>, the dumped\noutput will be restricted to that model, rather than the entire application.\nYou can also mix application names and model names.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database\nfrom which data will be dumped.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-natural-foreign\">\n<span class=\"sig-name descname\"><span class=\"pre\">--natural-foreign</span></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<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\n<p>When this option is specified, Django will use the <code class=\"docutils literal notranslate\"><span class=\"pre\">natural_key()</span></code> model\nmethod to serialize any foreign key and many-to-many relationship to objects of\nthe type that defines the method. If you are dumping <code class=\"docutils literal notranslate\"><span class=\"pre\">contrib.auth</span></code>\n<code class=\"docutils literal notranslate\"><span class=\"pre\">Permission</span></code> objects or <code class=\"docutils literal notranslate\"><span class=\"pre\">contrib.contenttypes</span></code> <code class=\"docutils literal notranslate\"><span class=\"pre\">ContentType</span></code> objects, you\nshould probably be using this flag. See the <a class=\"reference internal\" href=\"/en/1.8/topics/serialization/#topics-serialization-natural-keys\"><span class=\"std std-ref\">natural keys</span></a> documentation for more details on this\nand 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\"><span class=\"pre\">--natural-primary</span></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<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\n<p>When this option is specified, Django will not provide the primary key in the\nserialized data of this object since it can be calculated during\ndeserialization.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-natural\">\n<span class=\"sig-name descname\"><span class=\"pre\">--natural</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-dumpdata-natural\"><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-deprecated\" data-version=\"1.7\">\n<p class=\"version-note-title\">Deprecated since Django 1.7</p><p><span class=\"versionmodified deprecated\">Deprecated since version 1.7: </span>Equivalent to the <code class=\"docutils literal notranslate\"><span class=\"pre\">--natural-foreign</span></code> option; use that instead.</p>\n</aside>\n<p>Use <a class=\"reference internal\" href=\"/en/1.8/topics/serialization/#topics-serialization-natural-keys\"><span class=\"std std-ref\">natural keys</span></a> to represent\nany foreign key and many-to-many relationship with a model that provides\na natural key definition.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-pks\">\n<span class=\"sig-name descname\"><span class=\"pre\">--pks</span></span><span class=\"sig-prename descclassname\"></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>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> will output all the records of the model, but\nyou can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--pks</span></code> option to specify a comma separated list of\nprimary keys on which to filter.  This is only available when dumping\none model.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-dumpdata-output\">\n<span class=\"sig-name descname\"><span class=\"pre\">--output</span></span><span class=\"sig-prename descclassname\"></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>By default <code class=\"docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code> will output all the serialized data to standard output.\nThis option allows you to specify the file to which the data is to be written.</p>\n</section>\n<section id=\"flush\">\n<h3>flush<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">flush</span></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, re-executes any post-synchronization\nhandlers, and reinstalls any initial data fixtures.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--noinput</span></code> option may be provided to suppress all user\nprompts.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option may be used to specify the database\nto flush.</p>\n<section id=\"no-initial-data\">\n<h4><code class=\"docutils literal notranslate\"><span class=\"pre\">--no-initial-data</span></code><a class=\"heading-anchor\" href=\"#no-initial-data\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Use <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-initial-data</span></code> to avoid loading the initial_data fixture.</p>\n</section>\n</section>\n<section id=\"inspectdb\">\n<h3>inspectdb<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">inspectdb</span></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=\"/en/1.8/ref/settings/#std-setting-NAME\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">NAME</span></code></a> setting and outputs a Django model module (a <code class=\"docutils literal notranslate\"><span class=\"pre\">models.py</span></code>\nfile) to standard output.</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\"><span class=\"pre\">inspectdb</span></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\"><span class=\"pre\">inspectdb</span></code> cannot map a column’s type to a model field type, it’ll\nuse <code class=\"docutils literal notranslate\"><span class=\"pre\">TextField</span></code> and will insert the Python comment\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'This</span> <span class=\"pre\">field</span> <span class=\"pre\">type</span> <span class=\"pre\">is</span> <span class=\"pre\">a</span> <span class=\"pre\">guess.'</span></code> next to the field in the generated\nmodel.</p></li>\n<li><p>If the database column name is a Python reserved word (such as\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'pass'</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">'class'</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">'for'</span></code>), <code class=\"docutils literal notranslate\"><span class=\"pre\">inspectdb</span></code> will append\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'_field'</span></code> to the attribute name. For example, if a table has a column\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'for'</span></code>, the generated model will have a field <code class=\"docutils literal notranslate\"><span class=\"pre\">'for_field'</span></code>, with\nthe <code class=\"docutils literal notranslate\"><span class=\"pre\">db_column</span></code> attribute set to <code class=\"docutils literal notranslate\"><span class=\"pre\">'for'</span></code>. <code class=\"docutils literal notranslate\"><span class=\"pre\">inspectdb</span></code> will insert\nthe Python comment\n<code class=\"docutils literal notranslate\"><span class=\"pre\">'Field</span> <span class=\"pre\">renamed</span> <span class=\"pre\">because</span> <span class=\"pre\">it</span> <span class=\"pre\">was</span> <span class=\"pre\">a</span> <span class=\"pre\">Python</span> <span class=\"pre\">reserved</span> <span class=\"pre\">word.'</span></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>Primary keys are automatically introspected for PostgreSQL, MySQL and\nSQLite, in which case Django puts in the <code class=\"docutils literal notranslate\"><span class=\"pre\">primary_key=True</span></code> where\nneeded.</p>\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">inspectdb</span></code> works with PostgreSQL, MySQL and SQLite. Foreign-key detection\nonly works in PostgreSQL and with certain types of MySQL tables.</p>\n<p>Django doesn’t create database defaults when a\n<a class=\"reference internal\" href=\"/en/1.8/ref/models/fields/#django.db.models.Field.default\" title=\"django.db.models.Field.default\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">default</span></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\"><span class=\"pre\">inspectdb</span></code>.</p>\n<p>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">inspectdb</span></code> creates unmanaged models. That is, <code class=\"docutils literal notranslate\"><span class=\"pre\">managed</span> <span class=\"pre\">=</span> <span class=\"pre\">False</span></code>\nin the model’s <code class=\"docutils literal notranslate\"><span class=\"pre\">Meta</span></code> class tells Django not to manage each table’s creation,\nmodification, and deletion. If you do want to allow Django to manage the\ntable’s lifecycle, you’ll need to change the\n<a class=\"reference internal\" href=\"/en/1.8/ref/models/options/#django.db.models.Options.managed\" title=\"django.db.models.Options.managed\"><code class=\"xref py py-attr docutils literal notranslate\"><span class=\"pre\">managed</span></code></a> option to <code class=\"docutils literal notranslate\"><span class=\"pre\">True</span></code> (or simply remove\nit because <code class=\"docutils literal notranslate\"><span class=\"pre\">True</span></code> is its default value).</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option may be used to specify the\ndatabase to introspect.</p>\n</section>\n<section id=\"loaddata-fixture-fixture\">\n<h3>loaddata &lt;fixture fixture …&gt;<a class=\"heading-anchor\" href=\"#loaddata-fixture-fixture\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">loaddata</span></span><a class=\"heading-anchor\" href=\"#django-admin-loaddata\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Searches for and loads the contents of the named fixture into the database.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database\nonto which the data will be loaded.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-ignorenonexistent\">\n<span class=\"sig-name descname\"><span class=\"pre\">--ignorenonexistent</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--ignorenonexistent</span></code> option can be used to ignore fields and\nmodels that may have been removed since the fixture was originally generated.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-loaddata-app\">\n<span class=\"sig-name descname\"><span class=\"pre\">--app</span></span><span class=\"sig-prename descclassname\"></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--app</span></code> option can be used to specify a single app to look\nfor fixtures in rather than looking through all apps.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p><code class=\"docutils literal notranslate\"><span class=\"pre\">--app</span></code> was added.</p>\n</aside>\n<aside class=\"version-note version-changed\" data-version=\"1.8\">\n<p class=\"version-note-title\">Changed in Django 1.8</p><p><code class=\"docutils literal notranslate\"><span class=\"pre\">--ignorenonexistent</span></code> also ignores non-existent models.</p>\n</aside>\n<section id=\"what-s-a-fixture\">\n<h4>What’s a “fixture”?<a class=\"heading-anchor\" href=\"#what-s-a-fixture\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>A <em>fixture</em> is a collection of files that contain the serialized contents of\nthe database. Each fixture has a unique name, and the files that comprise the\nfixture can be distributed over multiple directories, in multiple applications.</p>\n<p>Django will search in three locations for fixtures:</p>\n<ol class=\"arabic simple\">\n<li><p>In the <code class=\"docutils literal notranslate\"><span class=\"pre\">fixtures</span></code> directory of every installed application</p></li>\n<li><p>In any directory named in the <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-FIXTURE_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">FIXTURE_DIRS</span></code></a> setting</p></li>\n<li><p>In the literal path named by the fixture</p></li>\n</ol>\n<p>Django will load any and all fixtures it finds in these locations that match\nthe provided fixture names.</p>\n<p>If the named fixture has a file extension, only fixtures of that type\nwill be loaded. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">loaddata</span> <span class=\"n\">mydata</span><span class=\"o\">.</span><span class=\"n\">json</span>\n</code></pre></div>\n<p>would only load JSON fixtures called <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata</span></code>. The fixture extension\nmust correspond to the registered name of a\n<a class=\"reference internal\" href=\"/en/1.8/topics/serialization/#serialization-formats\"><span class=\"std std-ref\">serializer</span></a> (e.g., <code class=\"docutils literal notranslate\"><span class=\"pre\">json</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">xml</span></code>).</p>\n<p>If you omit the extensions, Django will search all available fixture types\nfor a matching fixture. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">loaddata</span> <span class=\"n\">mydata</span>\n</code></pre></div>\n<p>would look for any fixture of any fixture type called <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata</span></code>. If a fixture\ndirectory contained <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json</span></code>, that fixture would be loaded\nas a JSON fixture.</p>\n<p>The fixtures that are named can include directory components. These\ndirectories will be included in the search path. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">loaddata</span> <span class=\"n\">foo</span><span class=\"o\">/</span><span class=\"n\">bar</span><span class=\"o\">/</span><span class=\"n\">mydata</span><span class=\"o\">.</span><span class=\"n\">json</span>\n</code></pre></div>\n<p>would search <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;app_label&gt;/fixtures/foo/bar/mydata.json</span></code> for each installed\napplication,  <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;dirname&gt;/foo/bar/mydata.json</span></code> for each directory in\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-FIXTURE_DIRS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">FIXTURE_DIRS</span></code></a>, and the literal path <code class=\"docutils literal notranslate\"><span class=\"pre\">foo/bar/mydata.json</span></code>.</p>\n<p>When fixture files are processed, the data is saved to the database as is.\nModel defined <a class=\"reference internal\" href=\"/en/1.8/ref/models/instances/#django.db.models.Model.save\" title=\"django.db.models.Model.save\"><code class=\"xref py py-meth docutils literal notranslate\"><span class=\"pre\">save()</span></code></a> methods are not called, and\nany <a class=\"reference internal\" href=\"/en/1.8/ref/signals/#django.db.models.signals.pre_save\" title=\"django.db.models.signals.pre_save\"><code class=\"xref py py-data docutils literal notranslate\"><span class=\"pre\">pre_save</span></code></a> or\n<a class=\"reference internal\" href=\"/en/1.8/ref/signals/#django.db.models.signals.post_save\" title=\"django.db.models.signals.post_save\"><code class=\"xref py py-data docutils literal notranslate\"><span class=\"pre\">post_save</span></code></a> signals will be called with\n<code class=\"docutils literal notranslate\"><span class=\"pre\">raw=True</span></code> since the instance only contains attributes that are local to the\nmodel. You may, for example, want to disable handlers that access\nrelated fields that aren’t present during fixture loading and would otherwise\nraise an exception:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">django.db.models.signals</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">post_save</span>\n<span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">.models</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">MyModel</span>\n\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">my_handler</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n    <span class=\"c1\"># disable the handler during fixture loading</span>\n    <span class=\"k\">if</span> <span class=\"n\">kwargs</span><span class=\"p\">[</span><span class=\"s1\">&#39;raw&#39;</span><span class=\"p\">]:</span>\n        <span class=\"k\">return</span>\n    <span class=\"o\">...</span>\n\n<span class=\"n\">post_save</span><span class=\"o\">.</span><span class=\"n\">connect</span><span class=\"p\">(</span><span class=\"n\">my_handler</span><span class=\"p\">,</span> <span class=\"n\">sender</span><span class=\"o\">=</span><span class=\"n\">MyModel</span><span class=\"p\">)</span>\n</code></pre></div>\n<p>You could also write a simple decorator to encapsulate this logic:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"kn\">from</span><span class=\"w\"> </span><span class=\"nn\">functools</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">wraps</span>\n\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">disable_for_loaddata</span><span class=\"p\">(</span><span class=\"n\">signal_handler</span><span class=\"p\">):</span>\n<span class=\"w\">    </span><span class=\"sd\">&quot;&quot;&quot;</span>\n<span class=\"sd\">    Decorator that turns off signal handlers when loading fixture data.</span>\n<span class=\"sd\">    &quot;&quot;&quot;</span>\n    <span class=\"nd\">@wraps</span><span class=\"p\">(</span><span class=\"n\">signal_handler</span><span class=\"p\">)</span>\n    <span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">wrapper</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n        <span class=\"k\">if</span> <span class=\"n\">kwargs</span><span class=\"p\">[</span><span class=\"s1\">&#39;raw&#39;</span><span class=\"p\">]:</span>\n            <span class=\"k\">return</span>\n        <span class=\"n\">signal_handler</span><span class=\"p\">(</span><span class=\"o\">*</span><span class=\"n\">args</span><span class=\"p\">,</span> <span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">)</span>\n    <span class=\"k\">return</span> <span class=\"n\">wrapper</span>\n\n<span class=\"nd\">@disable_for_loaddata</span>\n<span class=\"k\">def</span><span class=\"w\"> </span><span class=\"nf\">my_handler</span><span class=\"p\">(</span><span class=\"o\">**</span><span class=\"n\">kwargs</span><span class=\"p\">):</span>\n    <span class=\"o\">...</span>\n</code></pre></div>\n<p>Just be aware that this logic will disable the signals whenever fixtures are\ndeserialized, not just during <code class=\"docutils literal notranslate\"><span class=\"pre\">loaddata</span></code>.</p>\n<p>Note that the order in which fixture files are processed is undefined. However,\nall fixture data is installed as a single transaction, so data in\none fixture can reference data in another fixture. If the database backend\nsupports row-level constraints, these constraints will be checked at the\nend of the transaction.</p>\n<p>The <a class=\"reference internal\" href=\"#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code></a> command can be used to generate input for <code class=\"docutils literal notranslate\"><span class=\"pre\">loaddata</span></code>.</p>\n</section>\n<section id=\"compressed-fixtures\">\n<h4>Compressed fixtures<a class=\"heading-anchor\" href=\"#compressed-fixtures\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>Fixtures may be compressed in <code class=\"docutils literal notranslate\"><span class=\"pre\">zip</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">gz</span></code>, or <code class=\"docutils literal notranslate\"><span class=\"pre\">bz2</span></code> format. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">loaddata</span> <span class=\"n\">mydata</span><span class=\"o\">.</span><span class=\"n\">json</span>\n</code></pre></div>\n<p>would look for any of <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json.zip</span></code>,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json.gz</span></code>, or <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json.bz2</span></code>. The first file contained within a\nzip-compressed archive is used.</p>\n<p>Note that if two fixtures with the same name but different\nfixture type are discovered (for example, if <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.json</span></code> and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.xml.gz</span></code> were found in the same fixture directory), fixture\ninstallation will be aborted, and any data installed in the call to\n<code class=\"docutils literal notranslate\"><span class=\"pre\">loaddata</span></code> will be removed from the database.</p>\n<aside class=\"admonition-mysql-with-myisam-and-fixtures admonition\">\n<p class=\"admonition-title\">MySQL with MyISAM and fixtures</p>\n<p>The MyISAM storage engine of MySQL doesn’t support transactions or\nconstraints, so if you use MyISAM, you won’t get validation of fixture\ndata, or a rollback if multiple transaction files are found.</p>\n</aside>\n</section>\n<section id=\"database-specific-fixtures\">\n<h4>Database-specific fixtures<a class=\"heading-anchor\" href=\"#database-specific-fixtures\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>If you’re in a multi-database setup, you might have fixture data that\nyou want to load onto one database, but not onto another. In this\nsituation, you can add a database identifier into the names of your fixtures.</p>\n<p>For example, if your <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-DATABASES\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">DATABASES</span></code></a> setting has a ‘master’ database\ndefined, name the fixture <code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.master.json</span></code> or\n<code class=\"docutils literal notranslate\"><span class=\"pre\">mydata.master.json.gz</span></code> and the fixture will only be loaded when you\nspecify you want to load data into the <code class=\"docutils literal notranslate\"><span class=\"pre\">master</span></code> database.</p>\n</section>\n</section>\n<section id=\"makemessages\">\n<h3>makemessages<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">makemessages</span></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\"><span class=\"pre\">compilemessages</span></code></a> for use with the builtin gettext support. See\nthe <a class=\"reference internal\" href=\"/en/1.8/topics/i18n/translation/#how-to-create-language-files\"><span class=\"std std-ref\">i18n documentation</span></a> for details.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-all\">\n<span class=\"sig-name descname\"><span class=\"pre\">--all</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--all</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-a</span></code> option to update the message files for all\navailable languages.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"nb\">all</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-extension\">\n<span class=\"sig-name descname\"><span class=\"pre\">--extension</span></span><span class=\"sig-prename descclassname\"></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--extension</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-e</span></code> option to specify a list of file extensions\nto examine (default: “.html”, “.txt”).</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">de</span> <span class=\"o\">--</span><span class=\"n\">extension</span> <span class=\"n\">xhtml</span>\n</code></pre></div>\n<p>Separate multiple extensions with commas or use -e or –extension multiple times:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">de</span> <span class=\"o\">--</span><span class=\"n\">extension</span><span class=\"o\">=</span><span class=\"n\">html</span><span class=\"p\">,</span><span class=\"n\">txt</span> <span class=\"o\">--</span><span class=\"n\">extension</span> <span class=\"n\">xml</span>\n</code></pre></div>\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--locale</span></code> option (or its shorter version <code class=\"docutils literal notranslate\"><span class=\"pre\">-l</span></code>) to\nspecify the locale(s) to process.</p>\n<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--exclude</span></code> option (or its shorter version <code class=\"docutils literal notranslate\"><span class=\"pre\">-x</span></code>) to\nspecify the locale(s) to exclude from processing. If not provided, no locales\nare excluded.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">fr</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">pt_BR</span> <span class=\"o\">-</span><span class=\"n\">l</span> <span class=\"n\">fr</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">pt_BR</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">fr</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">pt_BR</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">pt_BR</span> <span class=\"o\">-</span><span class=\"n\">x</span> <span class=\"n\">fr</span>\n</code></pre></div>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>Added the <code class=\"docutils literal notranslate\"><span class=\"pre\">--previous</span></code> option to the <code class=\"docutils literal notranslate\"><span class=\"pre\">msgmerge</span></code> command when merging\nwith existing po files.</p>\n</aside>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-domain\">\n<span class=\"sig-name descname\"><span class=\"pre\">--domain</span></span><span class=\"sig-prename descclassname\"></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--domain</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-d</span></code> option to change the domain of the messages files.\nCurrently supported:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">django</span></code> for all <code class=\"docutils literal notranslate\"><span class=\"pre\">*.py</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">*.html</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">*.txt</span></code> files (default)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">djangojs</span></code> for <code class=\"docutils literal notranslate\"><span class=\"pre\">*.js</span></code> files</p></li>\n</ul>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-symlinks\">\n<span class=\"sig-name descname\"><span class=\"pre\">--symlinks</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--symlinks</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-s</span></code> option to follow symlinks to directories when\nlooking for new translation strings.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">de</span> <span class=\"o\">--</span><span class=\"n\">symlinks</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-ignore\">\n<span class=\"sig-name descname\"><span class=\"pre\">--ignore</span></span><span class=\"sig-prename descclassname\"></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--ignore</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-i</span></code> option to ignore files or directories matching\nthe given <a class=\"reference external\" href=\"https://docs.python.org/3/library/glob.html#module-glob\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">glob</span></code></a>-style pattern. Use multiple times to ignore more.</p>\n<p>These patterns are used by default: <code class=\"docutils literal notranslate\"><span class=\"pre\">'CVS'</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">'.*'</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">'*~'</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">'*.pyc'</span></code></p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">makemessages</span> <span class=\"o\">--</span><span class=\"n\">locale</span><span class=\"o\">=</span><span class=\"n\">en_US</span> <span class=\"o\">--</span><span class=\"n\">ignore</span><span class=\"o\">=</span><span class=\"n\">apps</span><span class=\"o\">/*</span> <span class=\"o\">--</span><span class=\"n\">ignore</span><span class=\"o\">=</span><span class=\"n\">secret</span><span class=\"o\">/*.</span><span class=\"n\">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\"><span class=\"pre\">--no-default-ignore</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-default-ignore</span></code> option to disable the default values of\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--ignore</span></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\"><span class=\"pre\">--no-wrap</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-wrap</span></code> option to disable breaking long message lines into\nseveral 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\"><span class=\"pre\">--no-location</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-location</span></code> option to suppress writing ‘<code class=\"docutils literal notranslate\"><span class=\"pre\">#:</span> <span class=\"pre\">filename:line</span></code>’\ncomment lines in language files. Note that using this option makes it harder\nfor technically skilled translators to understand each message’s context.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemessages-keep-pot\">\n<span class=\"sig-name descname\"><span class=\"pre\">--keep-pot</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--keep-pot</span></code> option to prevent Django from deleting the temporary\n<code class=\"docutils literal notranslate\"><span class=\"pre\">.pot</span></code> files it generates before creating the .po file. This is useful for\ndebugging errors which may prevent the final language files from being created.</p>\n<aside class=\"admonition admonition-seealso\">\n<p class=\"admonition-title\">See also</p>\n<p>See <a class=\"reference internal\" href=\"/en/1.8/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\"><span class=\"pre\">makemessages</span></code></a> passes to <code class=\"docutils literal notranslate\"><span class=\"pre\">xgettext</span></code>.</p>\n</aside>\n</section>\n<section id=\"makemigrations-app-label\">\n<h3>makemigrations [&lt;app_label&gt;]<a class=\"heading-anchor\" href=\"#makemigrations-app-label\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">makemigrations</span></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<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\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=\"/en/1.8/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\"><span class=\"pre\">ForeignKey</span></code>, for example).</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-empty\">\n<span class=\"sig-name descname\"><span class=\"pre\">--empty</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--empty</span></code> option will cause <code class=\"docutils literal notranslate\"><span class=\"pre\">makemigrations</span></code> to output an empty\nmigration for the specified apps, for manual editing. This option is only\nfor advanced users and should not be used unless you are familiar with\nthe migration format, migration operations, and the dependencies between\nyour migrations.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-dry-run\">\n<span class=\"sig-name descname\"><span class=\"pre\">--dry-run</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--dry-run</span></code> option shows what migrations would be made without\nactually writing any migrations files to disk. Using this option along with\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span> <span class=\"pre\">3</span></code> will also show the complete migrations files that would be\nwritten.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-merge\">\n<span class=\"sig-name descname\"><span class=\"pre\">--merge</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--merge</span></code> option enables fixing of migration conflicts. The\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--noinput</span></code> option may be provided to suppress user prompts during\na merge.</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\"><span class=\"pre\">--name</span></span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\"><span class=\"pre\">,</span> </span><span class=\"sig-name descname\"><span class=\"pre\">-n</span></span><span class=\"sig-prename descclassname\"></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--name</span></code> option allows you to give the migration(s) a custom name instead\nof a generated one.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-makemigrations-exit\">\n<span id=\"cmdoption-makemigrations-e\"></span><span class=\"sig-name descname\"><span class=\"pre\">--exit</span></span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\"><span class=\"pre\">,</span> </span><span class=\"sig-name descname\"><span class=\"pre\">-e</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-makemigrations-exit\"><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=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--exit</span></code> option will cause <code class=\"docutils literal notranslate\"><span class=\"pre\">makemigrations</span></code> to exit with error code 1\nwhen no migrations are created (or would have been created, if combined with\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--dry-run</span></code>).</p>\n</section>\n<section id=\"migrate-app-label-migrationname\">\n<h3>migrate [&lt;app_label&gt; [&lt;migrationname&gt;]]<a class=\"heading-anchor\" href=\"#migrate-app-label-migrationname\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">migrate</span></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<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\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=\"/en/1.8/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 migrated apps have all of their migrations run,\nand all unmigrated apps are synchronized with the database,</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;app_label&gt;</span></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\"><span class=\"pre\">&lt;app_label&gt;</span> <span class=\"pre\">&lt;migrationname&gt;</span></code>: Brings the database schema to a state where\nthe named migration is applied, but no later migrations in the same app are\napplied. This may involve unapplying migrations if you have previously\nmigrated past the named migration. Use the name <code class=\"docutils literal notranslate\"><span class=\"pre\">zero</span></code> to unapply all\nmigrations for an app.</p></li>\n</ul>\n<p>Unlike <code class=\"docutils literal notranslate\"><span class=\"pre\">syncdb</span></code>, this command does not prompt you to create a superuser if\none doesn’t exist (assuming you are using <a class=\"reference internal\" href=\"/en/1.8/topics/auth/#module-django.contrib.auth\" title=\"django.contrib.auth: Django's authentication framework.\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">django.contrib.auth</span></code></a>). Use\n<a class=\"reference internal\" href=\"#django-admin-createsuperuser\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">createsuperuser</span></code></a> to do that if you wish.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database to\nmigrate.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-migrate-fake\">\n<span class=\"sig-name descname\"><span class=\"pre\">--fake</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--fake</span></code> option tells Django to mark the migrations as having been\napplied or unapplied, but without actually running the SQL to change your\ndatabase 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\"><span class=\"pre\">--fake</span></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\"><span class=\"pre\">--fake-initial</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--fake-initial</span></code> option can be used to allow Django to skip an app’s\ninitial migration if all database tables with the names of all models created\nby all <a class=\"reference internal\" href=\"/en/1.8/ref/migration-operations/#django.db.migrations.operations.CreateModel\" title=\"django.db.migrations.operations.CreateModel\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">CreateModel</span></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<aside class=\"version-note version-deprecated\" data-version=\"1.8\">\n<p class=\"version-note-title\">Deprecated since Django 1.8</p><p><span class=\"versionmodified deprecated\">Deprecated since version 1.8: </span>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--list</span></code> option has been moved to the <a class=\"reference internal\" href=\"#django-admin-showmigrations\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">showmigrations</span></code></a>\ncommand.</p>\n</aside>\n</section>\n<section id=\"runfcgi-options\">\n<h3>runfcgi [options]<a class=\"heading-anchor\" href=\"#runfcgi-options\"><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-runfcgi\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">runfcgi</span></span><a class=\"heading-anchor\" href=\"#django-admin-runfcgi\"><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-deprecated\" data-version=\"1.7\">\n<p class=\"version-note-title\">Deprecated since Django 1.7</p><p><span class=\"versionmodified deprecated\">Deprecated since version 1.7: </span>FastCGI support is deprecated and will be removed in Django 1.9.</p>\n</aside>\n<p>Starts a set of FastCGI processes suitable for use with any Web server that\nsupports the FastCGI protocol. See the <a class=\"reference internal\" href=\"/en/1.8/howto/deployment/fastcgi/\"><span class=\"doc\">FastCGI deployment documentation</span></a> for details. Requires the Python FastCGI module from\n<a class=\"reference external\" href=\"http://www.saddi.com/software/flup/\">flup</a>.</p>\n<p>Internally, this wraps the WSGI application object specified by the\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-WSGI_APPLICATION\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">WSGI_APPLICATION</span></code></a> setting.</p>\n<p>The options accepted by this command are passed to the FastCGI library and\ndon’t use the <code class=\"docutils literal notranslate\"><span class=\"pre\">'--'</span></code> prefix as is usual for other Django management commands.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-protocol\">\n<span class=\"sig-name descname\"><span class=\"pre\">protocol</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-protocol\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">protocol=PROTOCOL</span></code></p>\n<p>Protocol to use. <em>PROTOCOL</em> can be <code class=\"docutils literal notranslate\"><span class=\"pre\">fcgi</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">scgi</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">ajp</span></code>, etc.\n(default is <code class=\"docutils literal notranslate\"><span class=\"pre\">fcgi</span></code>)</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-host\">\n<span class=\"sig-name descname\"><span class=\"pre\">host</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-host\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">host=HOSTNAME</span></code></p>\n<p>Hostname to listen on.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-port\">\n<span class=\"sig-name descname\"><span class=\"pre\">port</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-port\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">port=PORTNUM</span></code></p>\n<p>Port to listen on.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-socket\">\n<span class=\"sig-name descname\"><span class=\"pre\">socket</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-socket\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">socket=FILE</span></code></p>\n<p>UNIX socket to listen on.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-method\">\n<span class=\"sig-name descname\"><span class=\"pre\">method</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-method\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">method=IMPL</span></code></p>\n<p>Possible values: <code class=\"docutils literal notranslate\"><span class=\"pre\">prefork</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">threaded</span></code> (default <code class=\"docutils literal notranslate\"><span class=\"pre\">prefork</span></code>)</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-maxrequests\">\n<span class=\"sig-name descname\"><span class=\"pre\">maxrequests</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-maxrequests\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">maxrequests=NUMBER</span></code></p>\n<p>Number of requests a child handles before it is killed and a new child is\nforked (0 means no limit).</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-maxspare\">\n<span class=\"sig-name descname\"><span class=\"pre\">maxspare</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-maxspare\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">maxspare=NUMBER</span></code></p>\n<p>Max number of spare processes / threads.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-minspare\">\n<span class=\"sig-name descname\"><span class=\"pre\">minspare</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-minspare\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">minspare=NUMBER</span></code></p>\n<p>Min number of spare processes / threads.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-maxchildren\">\n<span class=\"sig-name descname\"><span class=\"pre\">maxchildren</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-maxchildren\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">maxchildren=NUMBER</span></code></p>\n<p>Hard limit number of processes / threads.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-daemonize\">\n<span class=\"sig-name descname\"><span class=\"pre\">daemonize</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-daemonize\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">daemonize=BOOL</span></code></p>\n<p>Whether to detach from terminal.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-pidfile\">\n<span class=\"sig-name descname\"><span class=\"pre\">pidfile</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-pidfile\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">pidfile=FILE</span></code></p>\n<p>Write the spawned process-id to file <em>FILE</em>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-workdir\">\n<span class=\"sig-name descname\"><span class=\"pre\">workdir</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-workdir\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">workdir=DIRECTORY</span></code></p>\n<p>Change to directory <em>DIRECTORY</em> when daemonizing.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-debug\">\n<span class=\"sig-name descname\"><span class=\"pre\">debug</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-debug\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">debug=BOOL</span></code></p>\n<p>Set to true to enable flup tracebacks.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-outlog\">\n<span class=\"sig-name descname\"><span class=\"pre\">outlog</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-outlog\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">outlog=FILE</span></code></p>\n<p>Write stdout to the <em>FILE</em> file.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-errlog\">\n<span class=\"sig-name descname\"><span class=\"pre\">errlog</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-errlog\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">errlog=FILE</span></code></p>\n<p>Write stderr to the <em>FILE</em> file.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runfcgi-arg-umask\">\n<span class=\"sig-name descname\"><span class=\"pre\">umask</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-runfcgi-arg-umask\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p><code class=\"docutils literal notranslate\"><span class=\"pre\">umask=UMASK</span></code></p>\n<p>Umask to use when daemonizing. The value is interpreted as an octal number\n(default value is <code class=\"docutils literal notranslate\"><span class=\"pre\">0o22</span></code>).</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runfcgi</span> <span class=\"n\">socket</span><span class=\"o\">=/</span><span class=\"n\">tmp</span><span class=\"o\">/</span><span class=\"n\">fcgi</span><span class=\"o\">.</span><span class=\"n\">sock</span> <span class=\"n\">method</span><span class=\"o\">=</span><span class=\"n\">prefork</span> <span class=\"n\">daemonize</span><span class=\"o\">=</span><span class=\"n\">true</span> \\\n    <span class=\"n\">pidfile</span><span class=\"o\">=/</span><span class=\"n\">var</span><span class=\"o\">/</span><span class=\"n\">run</span><span class=\"o\">/</span><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">fcgi</span><span class=\"o\">.</span><span class=\"n\">pid</span>\n</code></pre></div>\n<p>Run a FastCGI server as a daemon and write the spawned PID in a file.</p>\n</section>\n<section id=\"runserver-port-or-address-port\">\n<h3>runserver [port or address:port]<a class=\"heading-anchor\" href=\"#runserver-port-or-address-port\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">runserver</span></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\"><span class=\"pre\">127.0.0.1</span></code>. You can pass in an\nIP address and port number explicitly.</p>\n<p>If you run this script as a user with normal privileges (recommended), you\nmight not have access to start a port on a low port number. Low port numbers\nare reserved for the superuser (root).</p>\n<p>This server uses the WSGI application object specified by the\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-WSGI_APPLICATION\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">WSGI_APPLICATION</span></code></a> setting.</p>\n<p>DO NOT USE THIS SERVER IN A PRODUCTION SETTING. It has not gone through\nsecurity audits or performance tests. (And that’s how it’s gonna stay. We’re in\nthe business of making Web frameworks, not Web servers, so improving this\nserver to be able to handle a production environment is outside the scope of\nDjango.)</p>\n<p>The development server automatically reloads Python code for each request, as\nneeded. You don’t need to restart the server for code changes to take effect.\nHowever, some actions like adding files don’t trigger a restart, so you’ll\nhave to restart the server in these cases.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>Compiling translation files now also restarts the development server.</p>\n</aside>\n<p>If you are using Linux and install <a class=\"reference external\" href=\"https://pypi.python.org/pypi/pyinotify/\">pyinotify</a>, kernel signals will be used to\nautoreload the server (rather than polling file modification timestamps each\nsecond). This offers better scaling to large projects, reduction in response\ntime to code modification, more robust change detection, and battery usage\nreduction.</p>\n<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p><p><code class=\"docutils literal notranslate\"><span class=\"pre\">pyinotify</span></code> support was added.</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\"><span class=\"pre\">check</span></code></a> command). If any\nerrors are found, they will be printed to standard output.</p>\n<p>You can run as many concurrent servers as you want, as long as they’re on\nseparate ports. Just execute <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span> <span class=\"pre\">runserver</span></code> more than once.</p>\n<p>Note that the default IP address, <code class=\"docutils literal notranslate\"><span class=\"pre\">127.0.0.1</span></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\"><span class=\"pre\">192.168.2.1</span></code>) or\n<code class=\"docutils literal notranslate\"><span class=\"pre\">0.0.0.0</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">::</span></code> (with IPv6 enabled).</p>\n<p>You can provide an IPv6 address surrounded by brackets\n(e.g. <code class=\"docutils literal notranslate\"><span class=\"pre\">[200a::1]:8000</span></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=\"/en/1.8/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\"><span class=\"pre\">runserver</span></code></a> command will be overridden\nwith its own <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/staticfiles/#staticfiles-runserver\"><span class=\"std std-ref\">runserver</span></a> command.</p>\n<p>If <a class=\"reference internal\" href=\"#django-admin-migrate\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">migrate</span></code></a> was not previously executed, the table that stores the\nhistory of migrations is created at first run of <code class=\"docutils literal notranslate\"><span class=\"pre\">runserver</span></code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runserver-noreload\">\n<span class=\"sig-name descname\"><span class=\"pre\">--noreload</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--noreload</span></code> option to disable the use of the auto-reloader. This\nmeans any Python code changes you make while the server is running will <em>not</em>\ntake effect if the particular Python modules have already been loaded into\nmemory.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"o\">--</span><span class=\"n\">noreload</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-runserver-nothreading\">\n<span class=\"sig-name descname\"><span class=\"pre\">--nothreading</span></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>The development server is multithreaded by default. Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--nothreading</span></code>\noption to disable the use of threading in the development server.</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\"><span class=\"pre\">--ipv6</span></span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\"><span class=\"pre\">,</span> </span><span class=\"sig-name descname\"><span class=\"pre\">-6</span></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>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--ipv6</span></code> (or shorter <code class=\"docutils literal notranslate\"><span class=\"pre\">-6</span></code>) option to tell Django to use IPv6 for\nthe development server. This changes the default IP address from\n<code class=\"docutils literal notranslate\"><span class=\"pre\">127.0.0.1</span></code> to <code class=\"docutils literal notranslate\"><span class=\"pre\">::1</span></code>.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"o\">--</span><span class=\"n\">ipv6</span>\n</code></pre></div>\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\"><span class=\"pre\">127.0.0.1</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span>\n</code></pre></div>\n<p>Port 8000 on IP address <code class=\"docutils literal notranslate\"><span class=\"pre\">1.2.3.4</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n<p>Port 7000 on IP address <code class=\"docutils literal notranslate\"><span class=\"pre\">127.0.0.1</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 7000 on IP address <code class=\"docutils literal notranslate\"><span class=\"pre\">1.2.3.4</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 8000 on IPv6 address <code class=\"docutils literal notranslate\"><span class=\"pre\">::1</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"o\">-</span><span class=\"mi\">6</span>\n</code></pre></div>\n<p>Port 7000 on IPv6 address <code class=\"docutils literal notranslate\"><span class=\"pre\">::1</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"o\">-</span><span class=\"mi\">6</span> <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 7000 on IPv6 address <code class=\"docutils literal notranslate\"><span class=\"pre\">2001:0db8:1234:5678::9</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"p\">[</span><span class=\"mi\">2001</span><span class=\"p\">:</span><span class=\"mi\">0</span><span class=\"n\">db8</span><span class=\"p\">:</span><span class=\"mi\">1234</span><span class=\"p\">:</span><span class=\"mi\">5678</span><span class=\"p\">::</span><span class=\"mi\">9</span><span class=\"p\">]:</span><span class=\"mi\">7000</span>\n</code></pre></div>\n<p>Port 8000 on IPv4 address of host <code class=\"docutils literal notranslate\"><span class=\"pre\">localhost</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"n\">localhost</span><span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n<p>Port 8000 on IPv6 address of host <code class=\"docutils literal notranslate\"><span class=\"pre\">localhost</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">runserver</span> <span class=\"o\">-</span><span class=\"mi\">6</span> <span class=\"n\">localhost</span><span class=\"p\">:</span><span class=\"mi\">8000</span>\n</code></pre></div>\n</section>\n<section id=\"serving-static-files-with-the-development-server\">\n<h4>Serving static files with the development server<a class=\"heading-anchor\" href=\"#serving-static-files-with-the-development-server\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>By default, the development server doesn’t serve any static files for your site\n(such as CSS files, images, things under <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-MEDIA_URL\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">MEDIA_URL</span></code></a> and so forth). If\nyou want to configure Django to serve static media, read\n<a class=\"reference internal\" href=\"/en/1.8/howto/static-files/\"><span class=\"doc\">Managing static files (e.g. images, JavaScript, CSS)</span></a>.</p>\n</section>\n</section>\n<section id=\"shell\">\n<h3>shell<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">shell</span></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>Django will use <a class=\"reference external\" href=\"http://ipython.scipy.org/\">IPython</a> or <a class=\"reference external\" href=\"http://bpython-interpreter.org/\">bpython</a> if either is installed. If you have a\nrich shell installed but want to force use of the “plain” Python interpreter,\nuse the <code class=\"docutils literal notranslate\"><span class=\"pre\">--plain</span></code> option, like so:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">--</span><span class=\"n\">plain</span>\n</code></pre></div>\n<p>If you would like to specify either IPython or bpython as your interpreter if\nyou have both installed you can specify an alternative interpreter interface\nwith the <code class=\"docutils literal notranslate\"><span class=\"pre\">-i</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">--interface</span></code> options like so:</p>\n<p>IPython:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">-</span><span class=\"n\">i</span> <span class=\"n\">ipython</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">--</span><span class=\"n\">interface</span> <span class=\"n\">ipython</span>\n</code></pre></div>\n<p>bpython:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">-</span><span class=\"n\">i</span> <span class=\"n\">bpython</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">--</span><span class=\"n\">interface</span> <span class=\"n\">bpython</span>\n</code></pre></div>\n<p>When the “plain” Python interactive interpreter starts (be it because\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--plain</span></code> was specified or because no other interactive interface is\navailable) it reads the script pointed to by the <span class=\"target\" id=\"index-3\"></span><a class=\"reference external\" href=\"https://docs.python.org/3/using/cmdline.html#envvar-PYTHONSTARTUP\" title=\"(in Python v3.14)\"><code class=\"xref std std-envvar docutils literal notranslate\"><span class=\"pre\">PYTHONSTARTUP</span></code></a>\nenvironment variable and the <code class=\"docutils literal notranslate\"><span class=\"pre\">~/.pythonrc.py</span></code> script. If you don’t wish this\nbehavior you can use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-startup</span></code> option. e.g.:</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=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">shell</span> <span class=\"o\">--</span><span class=\"n\">plain</span> <span class=\"o\">--</span><span class=\"n\">no</span><span class=\"o\">-</span><span class=\"n\">startup</span>\n</code></pre></div>\n</section>\n<section id=\"showmigrations-app-label-app-label\">\n<h3>showmigrations [&lt;app_label&gt; [&lt;app_label&gt;]]<a class=\"heading-anchor\" href=\"#showmigrations-app-label-app-label\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">showmigrations</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>Shows all migrations in a project.</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\"><span class=\"pre\">--list</span></span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\"><span class=\"pre\">,</span> </span><span class=\"sig-name descname\"><span class=\"pre\">-l</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--list</span></code> option lists all of the apps Django knows about, the\nmigrations available for each app, and whether or not each migration is\napplied (marked by an <code class=\"docutils literal notranslate\"><span class=\"pre\">[X]</span></code> next to the migration name).</p>\n<p>Apps without migrations are also listed, but have <code class=\"docutils literal notranslate\"><span class=\"pre\">(no</span> <span class=\"pre\">migrations)</span></code> printed\nunder them.</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\"><span class=\"pre\">--plan</span></span><span class=\"sig-prename descclassname\"></span><span class=\"sig-prename descclassname\"><span class=\"pre\">,</span> </span><span class=\"sig-name descname\"><span class=\"pre\">-p</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--plan</span></code> option shows the migration plan Django will follow to apply\nmigrations. Any supplied app labels are ignored because the plan might go\nbeyond those apps. Same as <code class=\"docutils literal notranslate\"><span class=\"pre\">--list</span></code>, applied migrations are marked by an\n<code class=\"docutils literal notranslate\"><span class=\"pre\">[X]</span></code>. For a verbosity of 2 and above, all dependencies of a migration will\nalso be shown.</p>\n</section>\n<section id=\"sql-app-label-app-label\">\n<h3>sql &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sql-app-label-app-label\"><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-sql\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sql</span></span><a class=\"heading-anchor\" href=\"#django-admin-sql\"><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 CREATE TABLE SQL statements for the given app name(s).</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqlall-app-label-app-label\">\n<h3>sqlall &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqlall-app-label-app-label\"><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-sqlall\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlall</span></span><a class=\"heading-anchor\" href=\"#django-admin-sqlall\"><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 CREATE TABLE and initial-data SQL statements for the given app name(s).</p>\n<p>Refer to the description of <a class=\"reference internal\" href=\"#django-admin-sqlcustom\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">sqlcustom</span></code></a> for an explanation of how to\nspecify initial data.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n<aside class=\"version-note version-changed\" data-version=\"1.7\">\n<p class=\"version-note-title\">Changed in Django 1.7</p><p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">sql*</span></code> management commands now respect the <code class=\"docutils literal notranslate\"><span class=\"pre\">allow_migrate()</span></code> method\nof <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-DATABASE_ROUTERS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">DATABASE_ROUTERS</span></code></a>. If you have models synced to non-default\ndatabases, use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> flag to get SQL for those\nmodels (previously they would always be included in the output).</p>\n</aside>\n</section>\n<section id=\"sqlclear-app-label-app-label\">\n<h3>sqlclear &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqlclear-app-label-app-label\"><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-sqlclear\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlclear</span></span><a class=\"heading-anchor\" href=\"#django-admin-sqlclear\"><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 DROP TABLE SQL statements for the given app name(s).</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqlcustom-app-label-app-label\">\n<h3>sqlcustom &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqlcustom-app-label-app-label\"><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-sqlcustom\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlcustom</span></span><a class=\"heading-anchor\" href=\"#django-admin-sqlcustom\"><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 custom SQL statements for the given app name(s).</p>\n<p>For each model in each specified app, this command looks for the file\n<code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;app_label&gt;/sql/&lt;modelname&gt;.sql</span></code>, where <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;app_label&gt;</span></code> is the given app\nname and <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;modelname&gt;</span></code> is the model’s name in lowercase. For example, if you\nhave an app <code class=\"docutils literal notranslate\"><span class=\"pre\">news</span></code> that includes a <code class=\"docutils literal notranslate\"><span class=\"pre\">Story</span></code> model, <code class=\"docutils literal notranslate\"><span class=\"pre\">sqlcustom</span></code> will\nattempt to read a file <code class=\"docutils literal notranslate\"><span class=\"pre\">news/sql/story.sql</span></code> and append it to the output of\nthis command.</p>\n<p>Each of the SQL files, if given, is expected to contain valid SQL. The SQL\nfiles are piped directly into the database after all of the models’\ntable-creation statements have been executed. Use this SQL hook to make any\ntable modifications, or insert any SQL functions into the database.</p>\n<p>Note that the order in which the SQL files are processed is undefined.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqldropindexes-app-label-app-label\">\n<h3>sqldropindexes &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqldropindexes-app-label-app-label\"><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-sqldropindexes\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqldropindexes</span></span><a class=\"heading-anchor\" href=\"#django-admin-sqldropindexes\"><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 DROP INDEX SQL statements for the given app name(s).</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqlflush\">\n<h3>sqlflush<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlflush</span></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\"><span class=\"pre\">flush</span></code></a>\ncommand.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqlindexes-app-label-app-label\">\n<h3>sqlindexes &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqlindexes-app-label-app-label\"><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-sqlindexes\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlindexes</span></span><a class=\"heading-anchor\" href=\"#django-admin-sqlindexes\"><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 CREATE INDEX SQL statements for the given app name(s).</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"sqlmigrate-app-label-migrationname\">\n<h3>sqlmigrate &lt;app_label&gt; &lt;migrationname&gt;<a class=\"heading-anchor\" href=\"#sqlmigrate-app-label-migrationname\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlmigrate</span></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\"><span class=\"pre\">sqlmigrate</span></code> doesn’t colorize its output.</p>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to generate the SQL.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-sqlmigrate-backwards\">\n<span class=\"sig-name descname\"><span class=\"pre\">--backwards</span></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>By default, the SQL created is for running the migration in the forwards\ndirection. Pass <code class=\"docutils literal notranslate\"><span class=\"pre\">--backwards</span></code> to generate the SQL for\nunapplying the migration instead.</p>\n</section>\n<section id=\"sqlsequencereset-app-label-app-label\">\n<h3>sqlsequencereset &lt;app_label app_label …&gt;<a class=\"heading-anchor\" href=\"#sqlsequencereset-app-label-app-label\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">sqlsequencereset</span></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<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option can be used to specify the database for\nwhich to print the SQL.</p>\n</section>\n<section id=\"squashmigrations-app-label-migration-name\">\n<h3>squashmigrations &lt;app_label&gt; &lt;migration_name&gt;<a class=\"heading-anchor\" href=\"#squashmigrations-app-label-migration-name\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">squashmigrations</span></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\"><span class=\"pre\">app_label</span></code> up to and including <code class=\"docutils literal notranslate\"><span class=\"pre\">migration_name</span></code>\ndown into fewer migrations, if possible. The resulting squashed migrations\ncan live alongside the unsquashed ones safely. For more information,\nplease read <a class=\"reference internal\" href=\"/en/1.8/topics/migrations/#migration-squashing\"><span class=\"std std-ref\">Squashing migrations</span></a>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-squashmigrations-no-optimize\">\n<span class=\"sig-name descname\"><span class=\"pre\">--no-optimize</span></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>By default, Django will try to optimize the operations in your migrations\nto reduce the size of the resulting file. Pass <code class=\"docutils literal notranslate\"><span class=\"pre\">--no-optimize</span></code> if this\nprocess is failing for you or creating incorrect migrations, though please\nalso file a Django bug report about the behavior, as optimization is meant\nto be safe.</p>\n</section>\n<section id=\"startapp-app-label-destination\">\n<h3>startapp &lt;app_label&gt; [destination]<a class=\"heading-anchor\" href=\"#startapp-app-label-destination\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">startapp</span></span><a class=\"heading-anchor\" href=\"#django-admin-startapp\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates a Django app directory structure for the given app name in the current\ndirectory or the given destination.</p>\n<p>By default the directory created contains a <code class=\"docutils literal notranslate\"><span class=\"pre\">models.py</span></code> file and other app\ntemplate files. (See the <a class=\"reference external\" href=\"https://github.com/django/django/tree/master/django/conf/app_template/\">source</a> for more details.) If only the app\nname is given, the app directory will be created in the current working\ndirectory.</p>\n<p>If the optional destination is provided, Django will use that existing\ndirectory rather than creating a new one. You can use ‘.’ to denote the current\nworking directory.</p>\n<p>For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startapp</span> <span class=\"n\">myapp</span> <span class=\"o\">/</span><span class=\"n\">Users</span><span class=\"o\">/</span><span class=\"n\">jezdez</span><span class=\"o\">/</span><span class=\"n\">Code</span><span class=\"o\">/</span><span class=\"n\">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\"><span class=\"pre\">--template</span></span><span class=\"sig-prename descclassname\"></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>With the <code class=\"docutils literal notranslate\"><span class=\"pre\">--template</span></code> option, you can use a custom app template by providing\neither the path to a directory with the app template file, or a path to a\ncompressed file (<code class=\"docutils literal notranslate\"><span class=\"pre\">.tar.gz</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">.tar.bz2</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">.tgz</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">.tbz</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">.zip</span></code>)\ncontaining the app template files.</p>\n<p>For example, this would look for an app template in the given directory when\ncreating the <code class=\"docutils literal notranslate\"><span class=\"pre\">myapp</span></code> app:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startapp</span> <span class=\"o\">--</span><span class=\"n\">template</span><span class=\"o\">=/</span><span class=\"n\">Users</span><span class=\"o\">/</span><span class=\"n\">jezdez</span><span class=\"o\">/</span><span class=\"n\">Code</span><span class=\"o\">/</span><span class=\"n\">my_app_template</span> <span class=\"n\">myapp</span>\n</code></pre></div>\n<p>Django will also accept URLs (<code class=\"docutils literal notranslate\"><span class=\"pre\">http</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">https</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">ftp</span></code>) to compressed\narchives with the app template files, downloading and extracting them on the\nfly.</p>\n<p>For example, taking advantage of Github’s feature to expose repositories as\nzip files, you can use a URL like:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startapp</span> <span class=\"o\">--</span><span class=\"n\">template</span><span class=\"o\">=</span><span class=\"n\">https</span><span class=\"p\">:</span><span class=\"o\">//</span><span class=\"n\">github</span><span class=\"o\">.</span><span class=\"n\">com</span><span class=\"o\">/</span><span class=\"n\">githubuser</span><span class=\"o\">/</span><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">app</span><span class=\"o\">-</span><span class=\"n\">template</span><span class=\"o\">/</span><span class=\"n\">archive</span><span class=\"o\">/</span><span class=\"n\">master</span><span class=\"o\">.</span><span class=\"n\">zip</span> <span class=\"n\">myapp</span>\n</code></pre></div>\n<p>When Django copies the app template files, it also renders certain files\nthrough the template engine: the files whose extensions match the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--extension</span></code> option (<code class=\"docutils literal notranslate\"><span class=\"pre\">py</span></code> by default) and the files whose names are passed\nwith the <code class=\"docutils literal notranslate\"><span class=\"pre\">--name</span></code> option. The <a class=\"reference internal\" href=\"/en/1.8/ref/templates/api/#django.template.Context\" title=\"django.template.Context\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">template</span> <span class=\"pre\">context</span></code></a> used is:</p>\n<ul class=\"simple\">\n<li><p>Any option passed to the <code class=\"docutils literal notranslate\"><span class=\"pre\">startapp</span></code> command (among the command’s supported\noptions)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">app_name</span></code> – the app name as passed to the command</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">app_directory</span></code> – the full path of the newly created app</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">docs_version</span></code> – the version of the documentation: <code class=\"docutils literal notranslate\"><span class=\"pre\">'dev'</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">'1.x'</span></code></p></li>\n</ul>\n<aside class=\"admonition admonition-warning\" id=\"render-warning\" role=\"note\">\n<p class=\"admonition-title\">Warning</p>\n<p>When the app template files are rendered with the Django template\nengine (by default all <code class=\"docutils literal notranslate\"><span class=\"pre\">*.py</span></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=\"/en/1.8/ref/templates/builtins/#std-templatetag-templatetag\"><code class=\"xref std std-ttag docutils literal notranslate\"><span class=\"pre\">templatetag</span></code></a>\ntemplatetag to “escape” the various parts of the template syntax.</p>\n</aside>\n</section>\n<section id=\"startproject-projectname-destination\">\n<h3>startproject &lt;projectname&gt; [destination]<a class=\"heading-anchor\" href=\"#startproject-projectname-destination\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">startproject</span></span><a class=\"heading-anchor\" href=\"#django-admin-startproject\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Creates a Django project directory structure for the given project name in\nthe current directory or the given destination.</p>\n<p>By default, the new directory contains <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> and a project package\n(containing a <code class=\"docutils literal notranslate\"><span class=\"pre\">settings.py</span></code> and other files). See the <a class=\"reference external\" href=\"https://github.com/django/django/tree/master/django/conf/project_template/\">template source</a> for\ndetails.</p>\n<p>If only the project name is given, both the project directory and project\npackage will be named <code class=\"docutils literal notranslate\"><span class=\"pre\">&lt;projectname&gt;</span></code> and the project directory\nwill be created in the current working directory.</p>\n<p>If the optional destination is provided, Django will use that existing\ndirectory as the project directory, and create <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> and the project\npackage within it. Use ‘.’ to denote the current working directory.</p>\n<p>For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startproject</span> <span class=\"n\">myproject</span> <span class=\"o\">/</span><span class=\"n\">Users</span><span class=\"o\">/</span><span class=\"n\">jezdez</span><span class=\"o\">/</span><span class=\"n\">Code</span><span class=\"o\">/</span><span class=\"n\">myproject_repo</span>\n</code></pre></div>\n<p>As with the <a class=\"reference internal\" href=\"#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">startapp</span></code></a> command, the <code class=\"docutils literal notranslate\"><span class=\"pre\">--template</span></code> option lets you\nspecify a directory, file path or URL of a custom project template. See the\n<a class=\"reference internal\" href=\"#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">startapp</span></code></a> documentation for details of supported project template\nformats.</p>\n<p>For example, this would look for a project template in the given directory\nwhen creating the <code class=\"docutils literal notranslate\"><span class=\"pre\">myproject</span></code> project:</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=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startproject</span> <span class=\"o\">--</span><span class=\"n\">template</span><span class=\"o\">=/</span><span class=\"n\">Users</span><span class=\"o\">/</span><span class=\"n\">jezdez</span><span class=\"o\">/</span><span class=\"n\">Code</span><span class=\"o\">/</span><span class=\"n\">my_project_template</span> <span class=\"n\">myproject</span>\n</code></pre></div>\n<p>Django will also accept URLs (<code class=\"docutils literal notranslate\"><span class=\"pre\">http</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">https</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">ftp</span></code>) to compressed\narchives with the project template files, downloading and extracting them on the\nfly.</p>\n<p>For example, taking advantage of Github’s feature to expose repositories as\nzip files, you can use a URL like:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">startproject</span> <span class=\"o\">--</span><span class=\"n\">template</span><span class=\"o\">=</span><span class=\"n\">https</span><span class=\"p\">:</span><span class=\"o\">//</span><span class=\"n\">github</span><span class=\"o\">.</span><span class=\"n\">com</span><span class=\"o\">/</span><span class=\"n\">githubuser</span><span class=\"o\">/</span><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">project</span><span class=\"o\">-</span><span class=\"n\">template</span><span class=\"o\">/</span><span class=\"n\">archive</span><span class=\"o\">/</span><span class=\"n\">master</span><span class=\"o\">.</span><span class=\"n\">zip</span> <span class=\"n\">myproject</span>\n</code></pre></div>\n<p>When Django copies the project template files, it also renders certain files\nthrough the template engine: the files whose extensions match the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--extension</span></code> option (<code class=\"docutils literal notranslate\"><span class=\"pre\">py</span></code> by default) and the files whose names are passed\nwith the <code class=\"docutils literal notranslate\"><span class=\"pre\">--name</span></code> option. The <a class=\"reference internal\" href=\"/en/1.8/ref/templates/api/#django.template.Context\" title=\"django.template.Context\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">template</span> <span class=\"pre\">context</span></code></a> used is:</p>\n<ul class=\"simple\">\n<li><p>Any option passed to the <code class=\"docutils literal notranslate\"><span class=\"pre\">startproject</span></code> command (among the command’s\nsupported options)</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">project_name</span></code> – the project name as passed to the command</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">project_directory</span></code> – the full path of the newly created project</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">secret_key</span></code> – a random key for the <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-SECRET_KEY\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">SECRET_KEY</span></code></a> setting</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">docs_version</span></code> – the version of the documentation: <code class=\"docutils literal notranslate\"><span class=\"pre\">'dev'</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">'1.x'</span></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> as mentioned\nfor <a class=\"reference internal\" href=\"#django-admin-startapp\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">startapp</span></code></a>.</p>\n</section>\n<section id=\"syncdb\">\n<h3>syncdb<a class=\"heading-anchor\" href=\"#syncdb\"><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-syncdb\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">syncdb</span></span><a class=\"heading-anchor\" href=\"#django-admin-syncdb\"><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-deprecated\" data-version=\"1.7\">\n<p class=\"version-note-title\">Deprecated since Django 1.7</p><p><span class=\"versionmodified deprecated\">Deprecated since version 1.7: </span>This command has been deprecated in favor of the <a class=\"reference internal\" href=\"#django-admin-migrate\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">migrate</span></code></a>\ncommand, which performs both the old behavior as well as executing\nmigrations.</p>\n</aside>\n<p>Alias for <a class=\"reference internal\" href=\"#django-admin-migrate\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">migrate</span></code></a>, except that it also prompts you to create a\nsuperuser if one doesn’t exist (assuming you are using <code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.auth</span></code>).</p>\n</section>\n<section id=\"test-app-or-test-identifier\">\n<h3>test &lt;app or test identifier&gt;<a class=\"heading-anchor\" href=\"#test-app-or-test-identifier\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">test</span></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 models. See <a class=\"reference internal\" href=\"/en/1.8/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\"><span class=\"pre\">--failfast</span></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--failfast</span></code> option can be used to stop running tests and report the\nfailure 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\"><span class=\"pre\">--testrunner</span></span><span class=\"sig-prename descclassname\"></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>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--testrunner</span></code> option can be used to control the test runner class that\nis used to execute tests. If this value is provided, it overrides the value\nprovided by the <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-TEST_RUNNER\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">TEST_RUNNER</span></code></a> setting.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-liveserver\">\n<span class=\"sig-name descname\"><span class=\"pre\">--liveserver</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-test-liveserver\"><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\"><span class=\"pre\">--liveserver</span></code> option can be used to override the default address where\nthe live server (used with <a class=\"reference internal\" href=\"/en/1.8/topics/testing/tools/#django.test.LiveServerTestCase\" title=\"django.test.LiveServerTestCase\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">LiveServerTestCase</span></code></a>) is\nexpected to run from. The default value is <code class=\"docutils literal notranslate\"><span class=\"pre\">localhost:8081</span></code>.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-keepdb\">\n<span class=\"sig-name descname\"><span class=\"pre\">--keepdb</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--keepdb</span></code> option can be used to preserve the test database between test\nruns. This has the advantage of skipping both the create and destroy actions\nwhich can greatly decrease the time to run tests, especially those in a large\ntest suite. If the test database does not exist, it will be created on the first\nrun and then preserved for each subsequent run. Any unapplied migrations will also\nbe applied to the test database before running the test suite.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-reverse\">\n<span class=\"sig-name descname\"><span class=\"pre\">--reverse</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--reverse</span></code> option can be used to sort test cases in the opposite order.\nThis may help in debugging the side effects of tests that aren’t properly\nisolated. <a class=\"reference internal\" href=\"/en/1.8/topics/testing/overview/#order-of-tests\"><span class=\"std std-ref\">Grouping by test class</span></a> is preserved when using\nthis option.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-test-debug-sql\">\n<span class=\"sig-name descname\"><span class=\"pre\">--debug-sql</span></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<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--debug-sql</span></code> option can be used to enable <a class=\"reference internal\" href=\"/en/1.8/topics/logging/#django-db-logger\"><span class=\"std std-ref\">SQL logging</span></a> for failing tests. If <code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span></code> is <code class=\"docutils literal notranslate\"><span class=\"pre\">2</span></code>,\nthen queries in passing tests are also output.</p>\n</section>\n<section id=\"testserver-fixture-fixture\">\n<h3>testserver &lt;fixture fixture …&gt;<a class=\"heading-anchor\" href=\"#testserver-fixture-fixture\"><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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">testserver</span></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\"><span class=\"pre\">runserver</span></code></a>) using data from\nthe given fixture(s).</p>\n<p>For example, this command:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">testserver</span> <span class=\"n\">mydata</span><span class=\"o\">.</span><span class=\"n\">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=\"/en/1.8/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\"><span class=\"pre\">loaddata</span></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\"><span class=\"pre\">runserver</span></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=\"/en/1.8/topics/testing/overview/\"><span class=\"doc\">unit tests</span></a> of how your views\nact with certain fixture data, you can use <code class=\"docutils literal notranslate\"><span class=\"pre\">testserver</span></code> to interact with\nthe views in a Web browser, manually.</p></li>\n<li><p>Let’s say you’re developing your Django application and have a “pristine”\ncopy of a database that you’d like to interact with. You can dump your\ndatabase to a fixture (using the <a class=\"reference internal\" href=\"#django-admin-dumpdata\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">dumpdata</span></code></a> command, explained\nabove), then use <code class=\"docutils literal notranslate\"><span class=\"pre\">testserver</span></code> to run your Web application with that data.\nWith this arrangement, you have the flexibility of messing up your data\nin any way, knowing that whatever data changes you’re making are only\nbeing made to a test database.</p></li>\n</ul>\n<p>Note that this server does <em>not</em> automatically detect changes to your Python\nsource code (as <a class=\"reference internal\" href=\"#django-admin-runserver\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">runserver</span></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\"><span class=\"pre\">--addrport</span></span><span class=\"sig-prename descclassname\"> <span class=\"pre\">[port</span> <span class=\"pre\">number</span> <span class=\"pre\">or</span> <span class=\"pre\">ipaddr:port]</span></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>Use <code class=\"docutils literal notranslate\"><span class=\"pre\">--addrport</span></code> to specify a different port, or IP address and port, from\nthe default of <code class=\"docutils literal notranslate\"><span class=\"pre\">127.0.0.1:8000</span></code>. This value follows exactly the same format and\nserves exactly 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\"><span class=\"pre\">runserver</span></code></a>\ncommand.</p>\n<p>Examples:</p>\n<p>To run the test server on port 7000 with <code class=\"docutils literal notranslate\"><span class=\"pre\">fixture1</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">fixture2</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">testserver</span> <span class=\"o\">--</span><span class=\"n\">addrport</span> <span class=\"mi\">7000</span> <span class=\"n\">fixture1</span> <span class=\"n\">fixture2</span>\n<span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">testserver</span> <span class=\"n\">fixture1</span> <span class=\"n\">fixture2</span> <span class=\"o\">--</span><span class=\"n\">addrport</span> <span class=\"mi\">7000</span>\n</code></pre></div>\n<p>(The above statements are equivalent. We include both of them to demonstrate\nthat it doesn’t matter whether the options come before or after the fixture\narguments.)</p>\n<p>To run on 1.2.3.4:7000 with a <code class=\"docutils literal notranslate\"><span class=\"pre\">test</span></code> fixture:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">testserver</span> <span class=\"o\">--</span><span class=\"n\">addrport</span> <span class=\"mf\">1.2.3.4</span><span class=\"p\">:</span><span class=\"mi\">7000</span> <span class=\"n\">test</span>\n</code></pre></div>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">--noinput</span></code> option may be provided to suppress all user\nprompts.</p>\n</section>\n<section id=\"validate\">\n<h3>validate<a class=\"heading-anchor\" href=\"#validate\"><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-validate\">\n<span class=\"sig-name descname\"><span class=\"pre\">django-admin</span> <span class=\"pre\">validate</span></span><a class=\"heading-anchor\" href=\"#django-admin-validate\"><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-deprecated\" data-version=\"1.7\">\n<p class=\"version-note-title\">Deprecated since Django 1.7</p><p><span class=\"versionmodified deprecated\">Deprecated since version 1.7: </span>Replaced by the <a class=\"reference internal\" href=\"#django-admin-check\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">check</span></code></a> command.</p>\n</aside>\n<p>Validates all installed models (according to the <a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">INSTALLED_APPS</span></code></a>\nsetting) and prints validation errors to standard output.</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\"><span class=\"pre\">django.contrib</span></code> application that\n<a class=\"reference internal\" href=\"/en/1.8/howto/custom-management-commands/\"><span class=\"doc\">implements</span></a> them has been\n<a class=\"reference internal\" href=\"/en/1.8/ref/settings/#std-setting-INSTALLED_APPS\"><code class=\"xref std std-setting docutils literal notranslate\"><span class=\"pre\">enabled</span></code></a>. This section describes them grouped by\ntheir application.</p>\n<section id=\"django-contrib-auth\">\n<h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.auth</span></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>changepassword<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">changepassword</span></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=\"/en/1.8/topics/auth/\"><span class=\"doc\">authentication system</span></a> (<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.auth</span></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<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option to specify the database to query for the user. If\nit’s not supplied, Django will use the <code class=\"docutils literal notranslate\"><span class=\"pre\">default</span></code> database.</p>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">changepassword</span> <span class=\"n\">ringo</span>\n</code></pre></div>\n</section>\n<section id=\"createsuperuser\">\n<h4>createsuperuser<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">createsuperuser</span></span><a class=\"heading-anchor\" href=\"#django-admin-createsuperuser\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>This command is only available if Django’s <a class=\"reference internal\" href=\"/en/1.8/topics/auth/\"><span class=\"doc\">authentication system</span></a> (<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.auth</span></code>) is installed.</p>\n<p>Creates a superuser account (a user who has all permissions). This is\nuseful if you need to create an initial superuser account or if you need to\nprogrammatically generate superuser accounts for your site(s).</p>\n<p>When run interactively, this command will prompt for a password for\nthe new superuser account. When run non-interactively, no password\nwill be set, and the superuser account will not be able to log in until\na password has been manually set for it.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-createsuperuser-username\">\n<span class=\"sig-name descname\"><span class=\"pre\">--username</span></span><span class=\"sig-prename descclassname\"></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\"><span class=\"pre\">--email</span></span><span class=\"sig-prename descclassname\"></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\"><span class=\"pre\">--username</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">--email</span></code> arguments on the command\nline. If either of those is not supplied, <code class=\"docutils literal notranslate\"><span class=\"pre\">createsuperuser</span></code> will prompt for\nit when running interactively.</p>\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--database</span></code> option to specify the database into which the superuser\nobject will be saved.</p>\n<aside class=\"version-note version-added\" data-version=\"1.8\">\n<p class=\"version-note-title\">New in Django 1.8</p></aside>\n<p>You can subclass the management command and override <code class=\"docutils literal notranslate\"><span class=\"pre\">get_input_data()</span></code> if you\nwant to customize data input and validation. Consult the source code for\ndetails on the existing implementation and the method’s parameters. For example,\nit could be useful if you have a <code class=\"docutils literal notranslate\"><span class=\"pre\">ForeignKey</span></code> in\n<a class=\"reference internal\" href=\"/en/1.8/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\"><span class=\"pre\">REQUIRED_FIELDS</span></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-gis\">\n<h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.gis</span></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>ogrinspect<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=\"/en/1.8/ref/contrib/gis/\"><span class=\"doc\">GeoDjango</span></a>\n(<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.gis</span></code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/gis/commands/#django-admin-ogrinspect\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">description</span></code></a> in the GeoDjango\ndocumentation.</p>\n</section>\n</section>\n<section id=\"django-contrib-sessions\">\n<h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.sessions</span></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>clearsessions<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\"><span class=\"pre\">django-admin</span> <span class=\"pre\">clearsessions</span></span><a class=\"heading-anchor\" href=\"#django-admin-clearsessions\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Can be run as a cron job or directly to clean out expired sessions.</p>\n</section>\n</section>\n<section id=\"django-contrib-sitemaps\">\n<h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.sitemaps</span></code><a class=\"heading-anchor\" href=\"#django-contrib-sitemaps\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<section id=\"ping-google\">\n<h4>ping_google<a class=\"heading-anchor\" href=\"#ping-google\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h4>\n<p>This command is only available if the <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/sitemaps/\"><span class=\"doc\">Sitemaps framework</span></a> (<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.sitemaps</span></code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/sitemaps/#django-admin-ping_google\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">description</span></code></a> in the Sitemaps\ndocumentation.</p>\n</section>\n</section>\n<section id=\"django-contrib-staticfiles\">\n<h3><code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.staticfiles</span></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>collectstatic<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=\"/en/1.8/howto/static-files/\"><span class=\"doc\">static files application</span></a> (<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.staticfiles</span></code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/staticfiles/#django-admin-collectstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">description</span></code></a> in the\n<a class=\"reference internal\" href=\"/en/1.8/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> documentation.</p>\n</section>\n<section id=\"findstatic\">\n<h4>findstatic<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=\"/en/1.8/howto/static-files/\"><span class=\"doc\">static files application</span></a> (<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.staticfiles</span></code>) is installed.</p>\n<p>Please refer to its <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/staticfiles/#django-admin-findstatic\"><code class=\"xref std std-djadmin docutils literal notranslate\"><span class=\"pre\">description</span></code></a> in the <a class=\"reference internal\" href=\"/en/1.8/ref/contrib/staticfiles/\"><span class=\"doc\">staticfiles</span></a> documentation.</p>\n</section>\n</section>\n</section>\n<section id=\"default-options\">\n<h2>Default options<a class=\"heading-anchor\" href=\"#default-options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>Although some commands may allow their own custom options, every command\nallows for the following options:</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-pythonpath\">\n<span class=\"sig-name descname\"><span class=\"pre\">--pythonpath</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-pythonpath\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">migrate</span> <span class=\"o\">--</span><span class=\"n\">pythonpath</span><span class=\"o\">=</span><span class=\"s1\">&#39;/home/djangoprojects/myproject&#39;</span>\n</code></pre></div>\n<p>Adds the given filesystem path to the Python <a class=\"reference external\" href=\"http://www.diveintopython.net/getting_to_know_python/everything_is_an_object.html\">import search path</a>. If this\nisn’t provided, <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> will use the <code class=\"docutils literal notranslate\"><span class=\"pre\">PYTHONPATH</span></code> environment\nvariable.</p>\n<p>Note that this option is unnecessary in <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code>, because it takes care of\nsetting the Python path for you.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-settings\">\n<span class=\"sig-name descname\"><span class=\"pre\">--settings</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-settings\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">migrate</span> <span class=\"o\">--</span><span class=\"n\">settings</span><span class=\"o\">=</span><span class=\"n\">mysite</span><span class=\"o\">.</span><span class=\"n\">settings</span>\n</code></pre></div>\n<p>Explicitly specifies the settings module to use. The settings module should be\nin Python package syntax, e.g. <code class=\"docutils literal notranslate\"><span class=\"pre\">mysite.settings</span></code>. If this isn’t provided,\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> will use the <code class=\"docutils literal notranslate\"><span class=\"pre\">DJANGO_SETTINGS_MODULE</span></code> environment\nvariable.</p>\n<p>Note that this option is unnecessary in <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code>, because it uses\n<code class=\"docutils literal notranslate\"><span class=\"pre\">settings.py</span></code> from the current project by default.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-traceback\">\n<span class=\"sig-name descname\"><span class=\"pre\">--traceback</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-traceback\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">migrate</span> <span class=\"o\">--</span><span class=\"n\">traceback</span>\n</code></pre></div>\n<p>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> will show a simple error message whenever a\n<a class=\"reference internal\" href=\"/en/1.8/howto/custom-management-commands/#django.core.management.CommandError\" title=\"django.core.management.CommandError\"><code class=\"xref py py-class docutils literal notranslate\"><span class=\"pre\">CommandError</span></code></a> occurs, but a full stack trace\nfor any other exception. If you specify <code class=\"docutils literal notranslate\"><span class=\"pre\">--traceback</span></code>, <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>\nwill also output a full stack trace when a <code class=\"docutils literal notranslate\"><span class=\"pre\">CommandError</span></code> is raised.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-verbosity\">\n<span class=\"sig-name descname\"><span class=\"pre\">--verbosity</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-verbosity\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">migrate</span> <span class=\"o\">--</span><span class=\"n\">verbosity</span> <span class=\"mi\">2</span>\n</code></pre></div>\n<p>Use <code class=\"docutils literal notranslate\"><span class=\"pre\">--verbosity</span></code> to specify the amount of notification and debug information\nthat <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> should print to the console.</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">0</span></code> means no output.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">1</span></code> means normal output (default).</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">2</span></code> means verbose output.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">3</span></code> means <em>very</em> verbose output.</p></li>\n</ul>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-no-color\">\n<span class=\"sig-name descname\"><span class=\"pre\">--no-color</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-no-color\"><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=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\n<p>Example usage:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">sqlall</span> <span class=\"o\">--</span><span class=\"n\">no</span><span class=\"o\">-</span><span class=\"n\">color</span>\n</code></pre></div>\n<p>By default, <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> will format the output to be colorized. For\nexample, errors will be printed to the console in red and SQL statements will\nbe syntax highlighted. To prevent this and have a plain text output, pass the\n<code class=\"docutils literal notranslate\"><span class=\"pre\">--no-color</span></code> option when running your command.</p>\n</section>\n<section id=\"common-options\">\n<h2>Common options<a class=\"heading-anchor\" href=\"#common-options\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>The following options are not available on every command, but they are common\nto a number of commands.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-database\">\n<span class=\"sig-name descname\"><span class=\"pre\">--database</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-database\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Used to specify the database on which a command will operate. If not\nspecified, this option will default to an alias of <code class=\"docutils literal notranslate\"><span class=\"pre\">default</span></code>.</p>\n<p>For example, to dump data from the database with the alias <code class=\"docutils literal notranslate\"><span class=\"pre\">master</span></code>:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">dumpdata</span> <span class=\"o\">--</span><span class=\"n\">database</span><span class=\"o\">=</span><span class=\"n\">master</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-exclude\">\n<span class=\"sig-name descname\"><span class=\"pre\">--exclude</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-exclude\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Exclude a specific application from the applications whose contents is\noutput. For example, to specifically exclude the <code class=\"docutils literal notranslate\"><span class=\"pre\">auth</span></code> application from\nthe output of dumpdata, you would call:</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=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">dumpdata</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">auth</span>\n</code></pre></div>\n<p>If you want to exclude multiple applications, use multiple <code class=\"docutils literal notranslate\"><span class=\"pre\">--exclude</span></code>\ndirectives:</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=\"n\">django</span><span class=\"o\">-</span><span class=\"n\">admin</span> <span class=\"n\">dumpdata</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">auth</span> <span class=\"o\">--</span><span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"n\">contenttypes</span>\n</code></pre></div>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-locale\">\n<span class=\"sig-name descname\"><span class=\"pre\">--locale</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-locale\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--locale</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">-l</span></code> option to specify the locale to process.\nIf not provided all locales are processed.</p>\n<dl class=\"django-admin-option\">\n<dt class=\"sig sig-object\" id=\"cmdoption-clearsessions-noinput\">\n<span class=\"sig-name descname\"><span class=\"pre\">--noinput</span></span><span class=\"sig-prename descclassname\"></span><a class=\"heading-anchor\" href=\"#cmdoption-clearsessions-noinput\"><span class=\"visually-hidden\">Link to this definition</span><span aria-hidden=\"true\">#</span></a></dt>\n<dd></dd></dl>\n\n<p>Use the <code class=\"docutils literal notranslate\"><span class=\"pre\">--noinput</span></code> option to suppress all user prompting, such as “Are\nyou sure?” confirmation messages. This is useful if <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> is\nbeing executed as an unattended, automated script.</p>\n</section>\n<section id=\"extra-niceties\">\n<h2>Extra niceties<a class=\"heading-anchor\" href=\"#extra-niceties\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<section id=\"syntax-coloring\">\n<span id=\"id1\"></span><h3>Syntax coloring<a class=\"heading-anchor\" href=\"#syntax-coloring\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>The <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> / <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> commands will use pretty\ncolor-coded output if your terminal supports ANSI-colored output. It\nwon’t use the color codes if you’re piping the command’s output to\nanother program.</p>\n<p>Under Windows, the native console doesn’t support ANSI escape sequences so by\ndefault there is no color output. But you can install the <a class=\"reference external\" href=\"http://adoxa.altervista.org/ansicon/\">ANSICON</a>\nthird-party tool, the Django commands will detect its presence and will make\nuse of its services to color output just like on Unix-based platforms.</p>\n<p>The colors used for syntax highlighting can be customized. Django\nships with three color palettes:</p>\n<ul class=\"simple\">\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">dark</span></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\"><span class=\"pre\">light</span></code>, suited to terminals that show black text on a white\nbackground.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">nocolor</span></code>, which disables syntax highlighting.</p></li>\n</ul>\n<p>You select a palette by setting a <code class=\"docutils literal notranslate\"><span class=\"pre\">DJANGO_COLORS</span></code> environment\nvariable to specify the palette you want to use. For example, to\nspecify the <code class=\"docutils literal notranslate\"><span class=\"pre\">light</span></code> palette under a Unix or OS/X BASH shell, you\nwould run the following at a command prompt:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">export</span> <span class=\"n\">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\"><span class=\"pre\">error</span></code> - A major error.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">notice</span></code> - A minor error.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">warning</span></code> - A warning.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">sql_field</span></code> - The name of a model field in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">sql_coltype</span></code> - The type of a model field in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">sql_keyword</span></code> - An SQL keyword.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">sql_table</span></code> - The name of a model in SQL.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_info</span></code> - A 1XX HTTP Informational server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_success</span></code> - A 2XX HTTP Success server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_not_modified</span></code> - A 304 HTTP Not Modified server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_redirect</span></code> - A 3XX HTTP Redirect server response other than 304.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_not_found</span></code> - A 404 HTTP Not Found server response.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_bad_request</span></code> - A 4XX HTTP Bad Request server response other than 404.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">http_server_error</span></code> - A 5XX HTTP Server Error response.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">migrate_heading</span></code> - A heading in a migrations management command.</p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">migrate_label</span></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\"><span class=\"pre\">black</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">red</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">green</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">yellow</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">blue</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">magenta</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">cyan</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">white</span></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\"><span class=\"pre\">bold</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">underscore</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">blink</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">reverse</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">conceal</span></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\"><span class=\"pre\">role=fg</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">role=fg/bg</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">role=fg,option,option</span></code></p></li>\n<li><p><code class=\"docutils literal notranslate\"><span class=\"pre\">role=fg/bg,option,option</span></code></p></li>\n</ul>\n<p>where <code class=\"docutils literal notranslate\"><span class=\"pre\">role</span></code> is the name of a valid color role, <code class=\"docutils literal notranslate\"><span class=\"pre\">fg</span></code> is the\nforeground color, <code class=\"docutils literal notranslate\"><span class=\"pre\">bg</span></code> is the background color and each <code class=\"docutils literal notranslate\"><span class=\"pre\">option</span></code>\nis one of the color modifying options. Multiple color specifications\nare then separated by a semicolon. For example:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"n\">export</span> <span class=\"n\">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=\"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=\"n\">export</span> <span class=\"n\">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<aside class=\"version-note version-added\" data-version=\"1.7\">\n<p class=\"version-note-title\">New in Django 1.7</p></aside>\n<p>Support for color-coded output from <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> / <code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code>\nutilities on Windows by relying on the ANSICON application was added in Django\n1.7.</p>\n</section>\n<section id=\"bash-completion\">\n<h3>Bash completion<a class=\"heading-anchor\" href=\"#bash-completion\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h3>\n<p>If you use the Bash shell, consider installing the Django bash completion\nscript, which lives in <code class=\"docutils literal notranslate\"><span class=\"pre\">extras/django_bash_completion</span></code> in the Django\ndistribution. It enables tab-completion of <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code> and\n<code class=\"docutils literal notranslate\"><span class=\"pre\">manage.py</span></code> commands, so you can, for instance…</p>\n<ul class=\"simple\">\n<li><p>Type <code class=\"docutils literal notranslate\"><span class=\"pre\">django-admin</span></code>.</p></li>\n<li><p>Press [TAB] to see all available options.</p></li>\n<li><p>Type <code class=\"docutils literal notranslate\"><span class=\"pre\">sql</span></code>, then [TAB], to see all available options whose names start\nwith <code class=\"docutils literal notranslate\"><span class=\"pre\">sql</span></code>.</p></li>\n</ul>\n<p>See <a class=\"reference internal\" href=\"/en/1.8/howto/custom-management-commands/\"><span class=\"doc\">Writing custom django-admin commands</span></a> for how to add customized actions.</p>\n</section>\n</section>\n</section>\n<section id=\"running-management-commands-from-your-code\">\n<h1>Running management commands from your code<a class=\"heading-anchor\" href=\"#running-management-commands-from-your-code\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<dl class=\"py function\" id=\"call-command\">\n<dt class=\"sig sig-object py\" id=\"django.core.management.call_command\">\n<span class=\"sig-prename descclassname\"><span class=\"pre\">django.core.management.</span></span><span class=\"sig-name descname\"><span class=\"pre\">call_command</span></span><span class=\"sig-paren\">(</span><em class=\"sig-param\"><span class=\"n\"><span class=\"pre\">name</span></span></em>, <em class=\"sig-param\"><span class=\"o\"><span class=\"pre\">*</span></span><span class=\"n\"><span class=\"pre\">args</span></span></em>, <em class=\"sig-param\"><span class=\"o\"><span class=\"pre\">**</span></span><span class=\"n\"><span class=\"pre\">options</span></span></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\"><span class=\"pre\">call_command</span></code>.</p>\n<dl class=\"simple\">\n<dt><code class=\"docutils literal notranslate\"><span class=\"pre\">name</span></code></dt><dd><p>the name of the command to call.</p>\n</dd>\n<dt><code class=\"docutils literal notranslate\"><span class=\"pre\">*args</span></code></dt><dd><p>a list of arguments accepted by the command.</p>\n</dd>\n<dt><code class=\"docutils literal notranslate\"><span class=\"pre\">**options</span></code></dt><dd><p>named options accepted on the command-line.</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=\"w\"> </span><span class=\"nn\">django.core</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">management</span>\n<span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;flush&#39;</span><span class=\"p\">,</span> <span class=\"n\">verbosity</span><span class=\"o\">=</span><span class=\"mi\">0</span><span class=\"p\">,</span> <span class=\"n\">interactive</span><span class=\"o\">=</span><span class=\"kc\">False</span><span class=\"p\">)</span>\n<span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;loaddata&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;test_data&#39;</span><span class=\"p\">,</span> <span class=\"n\">verbosity</span><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\"><span class=\"pre\">True</span></code> or <code class=\"docutils literal notranslate\"><span class=\"pre\">False</span></code>, as you can see with the <code class=\"docutils literal notranslate\"><span class=\"pre\">interactive</span></code> option above.</p>\n<p>Named arguments can be passed by using either one of the following syntaxes:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"c1\"># Similar to the command line</span>\n<span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;--natural-foreign&#39;</span><span class=\"p\">)</span>\n\n<span class=\"c1\"># Named argument similar to the command line minus the initial dashes and</span>\n<span class=\"c1\"># with internal dashes replaced by underscores</span>\n<span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"n\">natural_foreign</span><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>\n<span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"n\">use_natural_foreign_keys</span><span class=\"o\">=</span><span class=\"kc\">True</span><span class=\"p\">)</span>\n</code></pre></div>\n<aside class=\"version-note version-changed\" data-version=\"1.8\">\n<p class=\"version-note-title\">Changed in Django 1.8</p><p>The first syntax is now supported thanks to management commands using the\n<a class=\"reference external\" href=\"https://docs.python.org/3/library/argparse.html#module-argparse\" title=\"(in Python v3.14)\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">argparse</span></code></a> module. For the second syntax, Django previously passed\nthe option name as-is to the command, now it is always using the <code class=\"docutils literal notranslate\"><span class=\"pre\">dest</span></code>\nvariable name (which may or may not be the same as the option name).</p>\n</aside>\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><span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"n\">exclude</span><span class=\"o\">=</span><span class=\"p\">[</span><span class=\"s1\">&#39;contenttypes&#39;</span><span class=\"p\">,</span> <span class=\"s1\">&#39;auth&#39;</span><span class=\"p\">])</span>\n</code></pre></div>\n<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\"><span class=\"pre\">stdout</span></code> and <code class=\"docutils literal notranslate\"><span class=\"pre\">stderr</span></code> options. For example, you could write:</p>\n<div class=\"code-block\" data-language=\"default\"><div class=\"code-block-toolbar\"><span class=\"code-block-language\">Code</span><button type=\"button\" class=\"copy-button\" data-copy hidden><span class=\"copy-button-label\">Copy</span></button></div><pre role=\"group\" tabindex=\"0\" aria-label=\"Code code\"><code><span class=\"k\">with</span> <span class=\"nb\">open</span><span class=\"p\">(</span><span class=\"s1\">&#39;/path/to/command_output&#39;</span><span class=\"p\">)</span> <span class=\"k\">as</span> <span class=\"n\">f</span><span class=\"p\">:</span>\n    <span class=\"n\">management</span><span class=\"o\">.</span><span class=\"n\">call_command</span><span class=\"p\">(</span><span class=\"s1\">&#39;dumpdata&#39;</span><span class=\"p\">,</span> <span class=\"n\">stdout</span><span class=\"o\">=</span><span class=\"n\">f</span><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 <appname appname …>","anchor":"check-appname-appname","children":[]},{"title":"compilemessages","anchor":"compilemessages","children":[]},{"title":"createcachetable","anchor":"createcachetable","children":[]},{"title":"dbshell","anchor":"dbshell","children":[]},{"title":"diffsettings","anchor":"diffsettings","children":[]},{"title":"dumpdata <app_label app_label app_label.Model …>","anchor":"dumpdata-app-label-app-label-app-label-model","children":[]},{"title":"flush","anchor":"flush","children":[{"title":"--no-initial-data","anchor":"no-initial-data","children":[]}]},{"title":"inspectdb","anchor":"inspectdb","children":[]},{"title":"loaddata <fixture fixture …>","anchor":"loaddata-fixture-fixture","children":[{"title":"What’s a “fixture”?","anchor":"what-s-a-fixture","children":[]},{"title":"Compressed fixtures","anchor":"compressed-fixtures","children":[]},{"title":"Database-specific fixtures","anchor":"database-specific-fixtures","children":[]}]},{"title":"makemessages","anchor":"makemessages","children":[]},{"title":"makemigrations [<app_label>]","anchor":"makemigrations-app-label","children":[]},{"title":"migrate [<app_label> [<migrationname>]]","anchor":"migrate-app-label-migrationname","children":[]},{"title":"runfcgi [options]","anchor":"runfcgi-options","children":[]},{"title":"runserver [port or address:port]","anchor":"runserver-port-or-address-port","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":"shell","anchor":"shell","children":[]},{"title":"showmigrations [<app_label> [<app_label>]]","anchor":"showmigrations-app-label-app-label","children":[]},{"title":"sql <app_label app_label …>","anchor":"sql-app-label-app-label","children":[]},{"title":"sqlall <app_label app_label …>","anchor":"sqlall-app-label-app-label","children":[]},{"title":"sqlclear <app_label app_label …>","anchor":"sqlclear-app-label-app-label","children":[]},{"title":"sqlcustom <app_label app_label …>","anchor":"sqlcustom-app-label-app-label","children":[]},{"title":"sqldropindexes <app_label app_label …>","anchor":"sqldropindexes-app-label-app-label","children":[]},{"title":"sqlflush","anchor":"sqlflush","children":[]},{"title":"sqlindexes <app_label app_label …>","anchor":"sqlindexes-app-label-app-label","children":[]},{"title":"sqlmigrate <app_label> <migrationname>","anchor":"sqlmigrate-app-label-migrationname","children":[]},{"title":"sqlsequencereset <app_label app_label …>","anchor":"sqlsequencereset-app-label-app-label","children":[]},{"title":"squashmigrations <app_label> <migration_name>","anchor":"squashmigrations-app-label-migration-name","children":[]},{"title":"startapp <app_label> [destination]","anchor":"startapp-app-label-destination","children":[]},{"title":"startproject <projectname> [destination]","anchor":"startproject-projectname-destination","children":[]},{"title":"syncdb","anchor":"syncdb","children":[]},{"title":"test <app or test identifier>","anchor":"test-app-or-test-identifier","children":[]},{"title":"testserver <fixture fixture …>","anchor":"testserver-fixture-fixture","children":[]},{"title":"validate","anchor":"validate","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.gis","anchor":"django-contrib-gis","children":[{"title":"ogrinspect","anchor":"ogrinspect","children":[]}]},{"title":"django.contrib.sessions","anchor":"django-contrib-sessions","children":[{"title":"clearsessions","anchor":"clearsessions","children":[]}]},{"title":"django.contrib.sitemaps","anchor":"django-contrib-sitemaps","children":[{"title":"ping_google","anchor":"ping-google","children":[]}]},{"title":"django.contrib.staticfiles","anchor":"django-contrib-staticfiles","children":[{"title":"collectstatic","anchor":"collectstatic","children":[]},{"title":"findstatic","anchor":"findstatic","children":[]}]}]},{"title":"Default options","anchor":"default-options","children":[]},{"title":"Common options","anchor":"common-options","children":[]},{"title":"Extra niceties","anchor":"extra-niceties","children":[{"title":"Syntax coloring","anchor":"syntax-coloring","children":[]},{"title":"Bash completion","anchor":"bash-completion","children":[]}]}]},{"title":"Running management commands from your code","anchor":"running-management-commands-from-your-code","children":[{"title":"Output redirection","anchor":"output-redirection","children":[]}]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/en/1.8/ref/"}],"prev":{"docname":"ref/databases","title":"Databases","url":"/en/1.8/ref/databases/"},"next":{"docname":"ref/exceptions","title":"Django Exceptions","url":"/en/1.8/ref/exceptions/"},"formats":{"html":"/en/1.8/ref/django-admin/","markdown":"/en/1.8/ref/django-admin.md","json":"/en/1.8/ref/django-admin.json"},"source":"https://github.com/django/django/blob/stable/1.8.x/docs/ref/django-admin.txt","official":"https://docs.djangoproject.com/en/1.8/ref/django-admin/","inVersions":["dev","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","1.8"],"inLocales":["en"]}