OverHeat OverHeat - 1 month ago 8
Python Question

Count visitors on your site with django

I want to import countviews app and embed it into my project.

I'm using

django 1.10
,
python 2.7


I used
pip install django-hitcount
and add
hitcount
into installed apps (myapp/settings.py).

When I run the server, I get an error:

myapphitcount module not found.


In directory MYAPP, I don't have folder hitcount.

Should I run
python manage.py startapp hitcount
?

Answer

Seems like you forgot to add a comma:

INSTALLED_APPS = (
    'myapp' # this must be followed by a comma
    'hitcount'
)

Since you haven't added a comma, python concatenates two strings 'myapp' and 'hitcount' into 'myapphitcount', so django can't find such application.