我目前正在升级我的Wagtail网站,并被卡住了。
W:1.13.4 Django:1.10.8
Site在Django 1.10.8中工作正常,但是当我尝试ImportError: cannot import name 'FieldPanel'
时在1.11中抛出python manage.py runserver
。
我没有任何迁移要做,并且我已经检查了我的Wagtail版本是否从1.5升级到了这一点。
我在一个名为member的应用程序中有一个自定义用户模型,并且在我的项目设置中将其声明为:
INSTALLED_APPS = [
'home',
'search',
'overextends',
'dashboard',
'lineage',
'gunicorn',
'wagtail.wagtailforms',
'wagtail.wagtailredirects',
'wagtail.wagtailembeds',
'wagtail.wagtailsites',
'wagtail.wagtailusers',
'wagtail.wagtailsnippets',
'wagtail.wagtaildocs',
'wagtail.wagtailimages',
'wagtail.wagtailsearch',
'wagtail.wagtailadmin',
'wagtail.wagtailcore',
'wagtail.contrib.modeladmin',
'members',
'modelcluster',
'compressor',
'taggit',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
#lots of extra stuff here.. editted for brevity...
WAGTAIL_SITE_NAME = "mySite"
AUTH_USER_MODEL = 'members.MyUser'
这是追溯:
Traceback (most recent call last):
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "C:\Python36\lib\site-packages\django\core\management\__init__.py", line 363, in execute_from_command_line
utility.execute()
File "C:\Python36\lib\site-packages\django\core\management\__init__.py", line 337, in execute
django.setup()
File "C:\Python36\lib\site-packages\django\__init__.py", line 27, in setup
apps.populate(settings.INSTALLED_APPS)
File "C:\Python36\lib\site-packages\django\apps\registry.py", line 108, in populate
app_config.import_models()
File "C:\Python36\lib\site-packages\django\apps\config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "C:\Users\maeda\Sites\la-print\home\models.py", line 9, in <module>
from wagtail.wagtailadmin.edit_handlers import (FieldPanel,
File "C:\Python36\lib\site-packages\wagtail\wagtailadmin\edit_handlers.py", line 27, in <module>
from .forms import ( # NOQA
File "C:\Python36\lib\site-packages\wagtail\wagtailadmin\forms.py", line 9, in <module>
from django.contrib.auth.forms import AuthenticationForm, PasswordResetForm
File "C:\Python36\lib\site-packages\django\contrib\auth\forms.py", line 22, in <module>
UserModel = get_user_model()
File "C:\Python36\lib\site-packages\django\contrib\auth\__init__.py", line 189, in get_user_model
return django_apps.get_model(settings.AUTH_USER_MODEL, require_ready=False)
File "C:\Python36\lib\site-packages\django\apps\registry.py", line 203, in get_model
app_config.import_models()
File "C:\Python36\lib\site-packages\django\apps\config.py", line 202, in import_models
self.models_module = import_module(models_module_name)
File "C:\Python36\lib\importlib\__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "C:\Users\maeda\Sites\la-print\members\models.py", line 17, in <module>
from wagtail.wagtailadmin.edit_handlers import (FieldPanel,
ImportError: cannot import name 'FieldPanel'