Migrating from django-hitcount¶
The project has been built with the idea to make the migrations as smooth as possible. After installation of dj-hitcount, run the migrations command to make the appropriate changes to the database (see the models section in this list for specifics).
python manage.py migrate hitcount
You will also have to make some changes if you were using any one of the following:
signals
delete_hit_countfromhitcount.modelshas been moved tohitcount.signals.
The argument
save_hitcountto the functiondelete_hit_count_handler(this process the signaldelete_hit_count) is nowkeyword-only. The earlier design pattern was a case of boolean-trap.
mixins
HitCountMixinfromhitcount.modelshas been renamed asHitCountModelMixinand moved tohitcount.mixins.
HitCountMixinfromhitcount.viewshas been renamed asHitCountViewMixinand moved tohitcount.mixins.
models
BlackListIPrenamed toBlockedIP.
BlackListUserAgentrenamed toBlockedUserAgent.
- The
ipfield forHitmodel has been made optional. This hopefully makes the project GDPR compliant. Please open an issue if still isn’t.
To maintain backwards compatibility with
django-hitcount, an additional setting HITCOUNT_USE_IP has been added.
views
hitcount.views.update_hit_count_ajaxthat was to be removed indjango-hitcount1.2has been removed. Usehitcount.views.HitCountJSONViewinstead.
hitcount.views._update_hit_countthat was to be removed indjango-hitcount1.2has been removed. Usehitcount.mixins.HitCountViewMixin.hit_countinstead.removed additional dependency of
django-etc.