Report errors :ModuleNotFoundError: No module named ‘haystack.urls’
solve :
pip uninstall haystack
pip install django-haystack
Report errors :cannot import name ‘smart_text’ from ‘django.utils.encoding’
solve :setting.py Add
import django
from django.utils.encoding import smart_str
django.utils.encoding.smart_text = smart_str
Report errors :ModuleNotFoundError: No module named ‘haystack.backends.whoosh_cn_backend’
solve :setting.py Revision in China
'ENGINE': 'haystack.backends.whoosh_cn_backend.WhooshEngine',
by :
'ENGINE': 'haystack.backends.whoosh_backend.WhooshEngine',
Report errors : cannot import name ‘url’ from ‘django.conf.urls’
solve :
pip install Whoosh
modify :
from django.conf.urls import url
by :
from django.urls import re_path as url
Report errors :django.db.utils.OperationalError: (1045, “Access denied for user ‘root’@‘localhost’ (using password: YES)”)
This is a mysql The password is wrong , Change to the correct password at the corresponding location :
Report errors :installing mysqlclient error: mysqlclient 1.4.0 or newer is required; you have 0.9.3
solve :
pip3 uninstall mysqlclient
pip3 uninstall pymysql
pip3 install mysqlclient
pip3 install pymysql