django.contrib.formtools

A set of high-level abstractions for Django forms (django.forms).

Historically, Django shipped with django.contrib.formtools – a collection of assorted utilities that are useful for specific form use cases. This code is now distributed separately from Django, for easier maintenance and to trim the size of Django’s codebase. In Django 1.8, importing from django.contrib.formtools will no longer work.

The new formtools package is named django-formtools, with a main module called formtools. Version 1.0 includes the same two primary features that the code included when it shipped with Django: a helper for form previews and a form wizard view.

See the official documentation for more information.

How to migrate

If you’ve used the old django.contrib.formtools package follow these two easy steps to update your code:

  1. Install version 1.0 of the third-party django-formtools package.

  2. Change your app’s import statements to reference the new packages.

    For example, change:

    from django.contrib.formtools.wizard.views import WizardView
    

    to:

    from formtools.wizard.views import WizardView
    

The code in version 1.0 of the new package is the same (it was copied directly from Django), so you don’t have to worry about backwards compatibility in terms of functionality. Only the imports have changed.

Back to Top