问题
I am trying to use the django hitcount, and I am following the only tutorial out there for it https://django-hitcount.readthedocs.io/en/latest/installation.html, and I am getting stuck on step 2--adding hitcount to the list of installed apps. When I do that, and try and run the server, I get the following error:
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
settings.py
INSTALLED_APPS = [
'hitcount',
'auctionitem.apps.AuctionitemConfig',
'blog.apps.BlogConfig',
'users.apps.UsersConfig',
'crispy_forms',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
Why!
来源:https://stackoverflow.com/questions/59720442/django-hit-count-importerror