0

我正在尝试使用 django hitcount,并且我正在关注那里唯一的教程https://django-hitcount.readthedocs.io/en/latest/installation.html,我被困在第 2 步 -将 hitcount 添加到已安装应用程序列表中。当我这样做并尝试运行服务器时,我收到以下错误:

ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

设置.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',
]

为什么!

4

1 回答 1

0

最新版本的 django-hitcount 现在支持 Django 3.x。

于 2020-04-30T20:35:39.580 回答