gpt4 book ai didi

python - 无法导入名称 FormWizard

转载 作者:行者123 更新时间:2023-11-28 16:39:22 25 4
gpt4 key购买 nike

关于使用“from django.contrib.formtools.wizard import FormWizard”在 forms.py 中继承特定表单类中的 formwizard。然后出现以下错误:

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

针对上述问题添加回溯,希望能提供一些帮助:

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

最佳答案

有一种可能性:您在 lib 文件夹中有两个 django 目录。一个是django1.3.1,另一个可能是django 1.6.1或更高版本:

如果您已经删除了您的应用程序不需要的任何人。

关于python - 无法导入名称 FormWizard,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21545889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com