A Django+Djangae app to collect session and access metrics.
Project description
==========================
Django Autometrics Non-Rel
==========================
This package installs models and middleware used to simplify user tracking across sessions and correlate access to resources to the user requesting such access.
Some of the tools in this project assume you are running in a non-relational environment (so far only Google App Engine is supported) for your views of interest. As such, the project depends on the `djangae` package. Some day perhaps I will split this into relational and non-relational sub-packages.
Quick start
-----------
The easiest way to use `django-autometrics-nonrel` is to use the `RestFrameworkGenericViewSetAutoMetricsMixin` to provide built-in recording of user retrieval of entities:
1. Add the project to your `INSTALLED_APPS` setting like this::
INSTALLED_APPS = [
...
'django_autometrics_nonrel',
]
1. Add the middleware to `MIDDLEWARE_CLASSES` anywhere **after** `SessionMiddleware`:
MIDDLEWARE_CLASSES = (
...
'django.contrib.sessions.middleware.SessionMiddleware',
'django_autometrics_nonrel.middleware.UserSessionTrackingMiddleware',
...
)
1. Use the mixin on your Django REST Framework GenericViewSet to automatically log user access to items:
from rest_framework import viewsets
from django_autometrics_nonrel import mixins
from myapp.models import MyModel
class MyViewSet(
viewsets.ReadOnlyModelViewSet,
RestFrameworkGenericViewSetAutoMetricsMixin
):
model = MyModel
queryset = MyModel.objects.all()
...
Django Autometrics Non-Rel
==========================
This package installs models and middleware used to simplify user tracking across sessions and correlate access to resources to the user requesting such access.
Some of the tools in this project assume you are running in a non-relational environment (so far only Google App Engine is supported) for your views of interest. As such, the project depends on the `djangae` package. Some day perhaps I will split this into relational and non-relational sub-packages.
Quick start
-----------
The easiest way to use `django-autometrics-nonrel` is to use the `RestFrameworkGenericViewSetAutoMetricsMixin` to provide built-in recording of user retrieval of entities:
1. Add the project to your `INSTALLED_APPS` setting like this::
INSTALLED_APPS = [
...
'django_autometrics_nonrel',
]
1. Add the middleware to `MIDDLEWARE_CLASSES` anywhere **after** `SessionMiddleware`:
MIDDLEWARE_CLASSES = (
...
'django.contrib.sessions.middleware.SessionMiddleware',
'django_autometrics_nonrel.middleware.UserSessionTrackingMiddleware',
...
)
1. Use the mixin on your Django REST Framework GenericViewSet to automatically log user access to items:
from rest_framework import viewsets
from django_autometrics_nonrel import mixins
from myapp.models import MyModel
class MyViewSet(
viewsets.ReadOnlyModelViewSet,
RestFrameworkGenericViewSetAutoMetricsMixin
):
model = MyModel
queryset = MyModel.objects.all()
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-autometrics-nonrel-0.9.1a2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6423ac6ff59403ae17ecf854a448c50f897a85288431ae1290458602ccec581b |
|
MD5 | 982a159337c5513e95b820b13b40f964 |
|
BLAKE2b-256 | bb7693abc7908004124bdbceee1dafb18b2f3db39d209d333c1fc467b183ab41 |
Close
Hashes for django_autometrics_nonrel-0.9.1a2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2d9eae1f41b83807231c8ac3e0c5202628f4c67aff40cd71d14127e2e445d58 |
|
MD5 | 6391c5c69bc041524ed448acaef1fdaa |
|
BLAKE2b-256 | 34535c2a560408b867e2d4080f1b69ff991b41f20350f41f708c61463c5f78c6 |