Unable to import FormWizard name

When using "from django.contrib.form.ool.wizard to import FormWizard" into forms.py to inherit formwizard in a specific form class. then get the following error:

ImportError at /APPLICATION/ashish

cannot import name FormWizard

Request Method:  POST
Request URL:  http://ec2-401-10-25-259.compute-1.amazonaws.com/APPLICATION/ashish
Django Version:  1.3.1
Exception Type:  ImportError
Exception Value:  

cannot import name FormWizard

Exception Location:  /var/www/STACK/DJANGO/PROJECT/APPLICATIO`enter code here`N/myapp/forms.py in <module>, line 28
Python Executable:  /usr/bin/python
Python Version:  2.6.6
Python Path:  

['/var/www/STACK/DJANGO/PROJECT/APPLICATION',
 '/usr/lib64/python26.zip',
 '/usr/lib64/python2.6',
 '/usr/lib64/python2.6/plat-linux2',
 '/usr/lib64/python2.6/lib-tk',
 '/usr/lib64/python2.6/lib-old',
 '/usr/lib64/python2.6/lib-dynload',
 '/usr/lib64/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages',
 '/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
 '/var/www/STACK/DJANGO/']

Server time:  Tue, 4 Feb 2014 01:41:14 -0500

Adding trace for the above problem, hope this provides some help:

TRACEBACK::


File "/usr/lib/python2.6/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/var/www/stacks/django-apps/hive/apps/accounts/views.py" in sms_code
  159.             return HttpResponseRedirect(reverse('login'))
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in reverse
  391.             *args, **kwargs)))
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in reverse
  312.         possibilities = self.reverse_dict.getlist(lookup_view)
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
  229.             self._populate()
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _populate
  208.                     for name in pattern.reverse_dict:
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_reverse_dict
  229.             self._populate()
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _populate
  197.         for pattern in reversed(self.url_patterns):
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_url_patterns
  279.         patterns = getattr(self.urlconf_module, "urlpatterns", self.urlconf_module)
File "/usr/lib/python2.6/site-packages/django/core/urlresolvers.py" in _get_urlconf_module
  274.             self._urlconf_module = import_module(self.urlconf_name)
File "/usr/lib/python2.6/site-packages/django/utils/importlib.py" in import_module
  35.     __import__(name)

File "/var/www/STACK/DJANGO/PROJECT/APPLICATION/myapp/views.py" in <module>
  15. from forms import HivReportForm, HivReportFormNew, CrossCheckForm 
File "//var/www/STACK/DJANGO/PROJECT/APPLICATION/myapp/forms.py" in <module>
  28. from django.contrib.formtools.wizard import FormWizard

Exception Type: ImportError at /accounts/smscode/
Exception Value: cannot import name FormWizard
+3
source share
3 answers

There is one possibility: you have two django directories in the lib folder. one is django1.3.1, and the other may be django version 1.6.1 or later:

if you then delete it, which is not required for your application.

+1
source

FormWizardno longer used. From the Django 1.4 release notes :

FormWizard django.contrib.formtools , Django 1.3. API .

. .

+1

I suggest you restore your virtualenvos at your centers. You are moving your code from ubuntu to cent os, so there might be a problem with the python version.

+1
source

All Articles