PhilippMatthes / djangostatistics

Reusable Django Statistics

Home Page:https://pypi.org/project/djangostatistics/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

djangostatistics

djangostatistics is a simple Django app for keeping track of interactions and display them in a generic statistics admin view.

Quick start

  1. Install djangostatistics via pip.

$ python3 -m pip install djangostatistics

  1. Add djangostatistics to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [
    # ...
    'djangostatistics',
]
  1. Include the djangostatistics admin site in your project's urls.py like this:
from djangostatistics.admin import admin_site as statistics_admin_site

urlpatterns = [
    # ...
    url(r'^statistics/', statistics_admin_site.urls),
]
  1. Run python manage.py migrate djangostatistics to create the djangostatistics models.

  2. Use the @new_interaction("Example Interaction") decorator to declare functions that should be logged as an "Example Interaction". Here is an example:

@new_interaction("Index Page Visit")
def index(request):
    # ...
  1. Start the development server and visit http://127.0.0.1:8000/statistics/ to view the statistics dashboard.

About

Reusable Django Statistics

https://pypi.org/project/djangostatistics/

License:GNU General Public License v3.0


Languages

Language:HTML 63.6%Language:Python 36.4%