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_count
fromhitcount.models
has been moved tohitcount.signals
.
The argument
save_hitcount
to 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
HitCountMixin
fromhitcount.models
has been renamed asHitCountModelMixin
and moved tohitcount.mixins
.
HitCountMixin
fromhitcount.views
has been renamed asHitCountViewMixin
and moved tohitcount.mixins
.
models
BlackListIP
renamed toBlockedIP
.
BlackListUserAgent
renamed toBlockedUserAgent
.
- The
ip
field forHit
model 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_ajax
that was to be removed indjango-hitcount
1.2
has been removed. Usehitcount.views.HitCountJSONView
instead.
hitcount.views._update_hit_count
that was to be removed indjango-hitcount
1.2
has been removed. Usehitcount.mixins.HitCountViewMixin.hit_count
instead.removed additional dependency of
django-etc
.