{"title":"django.contrib.formtools","version":"1.8","locale":"en","docname":"ref/contrib/formtools/index","url":"/en/1.8/ref/contrib/formtools/","canonical":"https://djangodocs.dev/en/1.8/ref/contrib/formtools/","summary":"A set of high-level abstractions for Django forms ( django.forms ). Historically, Django shipped with django.contrib.formtools – a collection of assorted utilities…","html":"<h1>django.contrib.formtools<a class=\"heading-anchor\" href=\"#django-contrib-formtools\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h1>\n<p>A set of high-level abstractions for Django forms (<a class=\"reference internal\" href=\"/en/1.8/ref/forms/api/#module-django.forms\" title=\"django.forms\"><code class=\"xref py py-mod docutils literal notranslate\"><span class=\"pre\">django.forms</span></code></a>).</p>\n<p>Historically, Django shipped with <code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.formtools</span></code> – a collection\nof assorted utilities that are useful for specific form use cases. This code is\nnow distributed separately from Django, for easier maintenance and to trim the\nsize of Django’s codebase. In Django 1.8, importing from\n<code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.formtools</span></code> will no longer work.</p>\n<p>The new formtools package is named <code class=\"docutils literal notranslate\"><span class=\"pre\">django-formtools</span></code>, with a main module\ncalled <code class=\"docutils literal notranslate\"><span class=\"pre\">formtools</span></code>. Version 1.0 includes the same two primary features that\nthe code included when it shipped with Django: a helper for form previews and a\nform wizard view.</p>\n<p>See the <a class=\"reference external\" href=\"http://django-formtools.readthedocs.org/\">official documentation</a> for more information.</p>\n<section id=\"how-to-migrate\">\n<span id=\"formtools-how-to-migrate\"></span><h2>How to migrate<a class=\"heading-anchor\" href=\"#how-to-migrate\"><span class=\"visually-hidden\">Link to this heading</span><span aria-hidden=\"true\">#</span></a></h2>\n<p>If you’ve used the old <code class=\"docutils literal notranslate\"><span class=\"pre\">django.contrib.formtools</span></code> package follow these\ntwo easy steps to update your code:</p>\n<ol class=\"arabic\">\n<li><p>Install version 1.0 of the third-party <code class=\"docutils literal notranslate\"><span class=\"pre\">django-formtools</span></code> package.</p></li>\n<li><p>Change your app’s import statements to reference the new packages.</p>\n<p>For example, change:</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.contrib.formtools.wizard.views</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">WizardView</span>\n</code></pre></div>\n<p>to:</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\">formtools.wizard.views</span><span class=\"w\"> </span><span class=\"kn\">import</span> <span class=\"n\">WizardView</span>\n</code></pre></div>\n</li>\n</ol>\n<p>The code in version 1.0 of the new package is the same (it was copied directly\nfrom Django), so you don’t have to worry about backwards compatibility in terms\nof functionality. Only the imports have changed.</p>\n</section>","rootId":"django-contrib-formtools","toc":[{"title":"How to migrate","anchor":"how-to-migrate","children":[]}],"breadcrumbs":[{"docname":"ref/index","title":"API Reference","url":"/en/1.8/ref/"},{"docname":"ref/contrib/index","title":"contrib packages","url":"/en/1.8/ref/contrib/"}],"prev":{"docname":"ref/contrib/flatpages","title":"The flatpages app","url":"/en/1.8/ref/contrib/flatpages/"},"next":{"docname":"ref/contrib/gis/index","title":"GeoDjango","url":"/en/1.8/ref/contrib/gis/"},"formats":{"html":"/en/1.8/ref/contrib/formtools/","markdown":"/en/1.8/ref/contrib/formtools.md","json":"/en/1.8/ref/contrib/formtools.json"},"source":"https://github.com/django/django/blob/stable/1.8.x/docs/ref/contrib/formtools/index.txt","official":"https://docs.djangoproject.com/en/1.8/ref/contrib/formtools/","inVersions":["1.8"],"inLocales":["en"]}