简体   繁体   中英

Django Hit Count ImportError

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM