Metadata-Version: 2.0
Name: django-lair
Version: 1.0.3
Summary: Analytics and metrics app to both store and display user actions
Home-page: https://github.com/narfman0/django_lair
Author: Jon Robison
Author-email: narfman0@gmail.com
License: MIT
Keywords: django_lair
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Framework :: Django
Classifier: Framework :: Django :: 1.8
Classifier: Framework :: Django :: 1.9
Classifier: Framework :: Django :: 1.10
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5

=============================
django_lair
=============================

.. image:: https://badge.fury.io/py/django_lair.png
    :target: https://badge.fury.io/py/django_lair

.. image:: https://travis-ci.org/narfman0/django_lair.png?branch=master
    :target: https://travis-ci.org/narfman0/django_lair

Analytics and metrics app to both store and display user actions

Documentation
-------------

django_lair will ingest user metrics, store in django configured database,
and show views for the user. Provides an API in your django application to
POST user data in key, value form to support arbitrary types of data.

Clients generate their own UUID and save locally. There is no special
authentication or authorization.

Quickstart
----------

Install django_lair::

    pip install django_lair

Add it to your `INSTALLED_APPS`:

.. code-block:: python

    INSTALLED_APPS = (
        ...
        'django_lair',
        ...
    )

Add django_lair's URL patterns:

.. code-block:: python

    from django_lair import urls as django_lair_urls


    urlpatterns = [
        ...
        url(r'^', include(django_lair_urls)),
        ...
    ]

Migrate app::

     ./manage.py migrate django_lair

Usage
-----

For the top level dashboard, navigate to `<endpoint>/datum/`, e.g.::

    http://localhost:8000/datum/

To create a new user with metric datum, POST to endpoint `/datum/create/`
with metric data. Make sure you use the `uuid` param (it is suggested to
always use uuid form)::

    curl --data "uuid=abcdefgh-1234-1234-9876-abcdefghijkl&name=metric1&value=value1" http://localhost:8000/datum/create/

To add metric data, POST to endpoint `/datum/create/` with user, metric
name, and metric value information::

    curl --data "user=abcdefgh-1234-1234-9876-abcdefghijkl&name=metric1&value=value1" http://localhost:8000/datum/create/

Be sure to include uuid/user, name, and value in the POST for each metric

Features
--------

* Stores users and shows list view of metrics hit
* Provides simplistic list view of saved datums including unique user graphs
* Provides detailed user page with frequency graph
* Search, sort, and filter paginated tables of user data

Running Tests
-------------

Does the code actually work?

::

    source <YOURVIRTUALENV>/bin/activate
    (myenv) $ pip install tox
    (myenv) $ tox


