从 2.14.2 升级到 Wagtail 2.15(或 2.15.1)后,我的生产网站带有 postgres 和数据库搜索中断以及运行的命令manage.py
给出错误,尽管我添加了所需WAGTAILSEARCH_BACKENDS
的设置。
我有两个具有不同设置的 Web 应用程序从同一个 Wagtail 版本运行。其中一个应用程序 (putkeep) 有一个搜索栏,而另一个 (secretgifter) 没有。将 Wagtail 从 2.14.2 升级到 2.15 后,putkeep 会给出 404 错误,但 secretgifter 不会。如果我使用 pip 切换回 2.14.2,则 404 错误消失并且网站加载(尽管搜索结果给出 500 错误)。
如果我为 secretgifter运行makemigrations
(或任何其他使用的命令)它工作正常。manage.py
对于 putkeep (带有搜索),它会给出以下错误:
File "manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
utility.execute()
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
django.setup()
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/django/apps/registry.py", line 122, in populate
app_config.ready()
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/apps.py", line 21, in ready
set_weights()
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 44, in set_weights
BOOSTS_WEIGHTS.extend(determine_boosts_weights())
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 32, in determine_boosts_weights
boosts = get_boosts()
File "/home/th-putkeep.net/putkeep/lib/python3.8/site-packages/wagtail/search/backends/database/postgres/weights.py", line 26, in get_boosts
boosts.add(boost)
TypeError: unhashable type: 'list'
根据文档,我已将此添加到我的设置中:
WAGTAILSEARCH_BACKENDS = {
'default': {
'BACKEND': 'wagtail.search.backends.database',
}
}
任何建议都非常感激。