{ "info": { "author": "Arnaud Renaud", "author_email": "arnaud.renaud@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP" ], "description": "Djaffar: asynchronous user activity tracking for Django\n=======================================================\n\n|Build Status| |PyPI version|\n\nWant to keep track of what your users do even when they don't hit the\nserver? Set up Djaffar on the server and make a request to the client\nAPI to log user activity to the database, including URI path, user name,\nbrowser session, IP address and user agent.\n\nRequirements\n------------\n\n- Django (1.8, 1.9, 1.10)\n- Django Rest Framework (3.3, 3.4, 3.5)\n\nInstallation\n------------\n\nInstall with ``pip``:\n\n::\n\n pip install django-djaffar\n\nAdd Djaffar to your project (typically in ``settings.py``):\n\n.. code:: python\n\n INSTALLED_APPS = [\n ...\n 'djaffar',\n ]\n\nSpecify the URL that will be used to hit Djaffar (typically in\n``urls.py``):\n\n.. code:: python\n\n from django.conf.urls import url, include\n\n urlpatterns = [\n ...\n url(r'^djaffar/', include('djaffar.urls')),\n ]\n\nMake sure the authentication classes you use for your users are\nspecified in the Django Rest Framework settings (typically in\n``settings.py``):\n\n.. code:: python\n\n REST_FRAMEWORK = {\n 'DEFAULT_AUTHENTICATION_CLASSES': (\n ...\n 'path.to.AuthenticationClass',\n )\n }\n\nRun the database migration:\n\n::\n\n $ python manage.py migrate djaffar\n\nClient API\n----------\n\nWhen sending a POST request to Djaffar to log activity, you should care\nabout the following properties:\n\n+----------------+------------+-------+---------+----------+--------+\n| Property name | Mandatory | Type | Format | Example | Usage |\n+================+============+=======+=========+==========+========+\n| ``date`` | Yes | Form | ISO | ``2016-1 | Date |\n| | | data | 8601 | 2-29T07: | and |\n| | | | | 35:22.57 | time |\n| | | | | 1Z`` | when |\n| | | | | | the |\n| | | | | | log |\n| | | | | | reques |\n| | | | | | t |\n| | | | | | is |\n| | | | | | initia |\n| | | | | | ted. |\n+----------------+------------+-------+---------+----------+--------+\n| ``path`` | No | Form | - | ``users/ | URL |\n| | | data | | me/cart/ | path |\n| | | | | `` | taken |\n| | | | | | by the |\n| | | | | | user. |\n| | | | | | If not |\n| | | | | | specif |\n| | | | | | ied, |\n| | | | | | the |\n| | | | | | refere |\n| | | | | | r |\n| | | | | | *from |\n| | | | | | the |\n| | | | | | reques |\n| | | | | | t |\n| | | | | | header |\n| | | | | | s* |\n| | | | | | (not |\n| | | | | | the |\n| | | | | | ``refe |\n| | | | | | rer`` |\n| | | | | | form |\n| | | | | | data |\n| | | | | | proper |\n| | | | | | ty) |\n| | | | | | will |\n| | | | | | be |\n| | | | | | used |\n| | | | | | in |\n| | | | | | place. |\n+----------------+------------+-------+---------+----------+--------+\n| ``referer`` | No | Form | - | ``https: | URL of |\n| | | data | | //www.go | the |\n| | | | | ogle.com | page |\n| | | | | /`` | the |\n| | | | | | user |\n| | | | | | comes |\n| | | | | | from |\n| | | | | | (if |\n| | | | | | any). |\n+----------------+------------+-------+---------+----------+--------+\n\nExamples\n~~~~~~~~\n\nBasic log\n^^^^^^^^^\n\nRequest Djaffar to log an activity with the current date:\n\n.. code:: javascript\n\n var xhr = new XMLHttpRequest();\n xhr.open('POST', '/djaffar/log/', true);\n xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\n xhr.send('date=' + new Date().toISOString());\n\nURL fragments\n^^^^^^^^^^^^^\n\nIf your client app relies on URL fragments for navigation, you'll need\nto manually set the ``path`` parameter when you hit Djaffar:\n\n.. code:: javascript\n\n ...\n xhr.send(... + '&path=' + (window.location.href.split('#')[1] || '/'))\n\nUser authentication\n^^^^^^^^^^^^^^^^^^^\n\n- If you use session-based authentication, the cookie is automatically\n set in the request headers by your browser.\n- But if you use token-based authentication, you'll need to set the\n token in the request headers, like so:\n\n .. code:: javascript\n\n ...\n xhr.setRequestHeader('Authorization', 'Bearer F2naN20HpDv4tsJC0b1OhQZVDwRiEy');\n xhr.send(...)\n\nRetrieving activity logs\n------------------------\n\nLogs are stored as instances of the ``Activity`` model (in\n``djaffar.models``) and have the following properties:\n\n+-------------------+--------------+-------------------+\n| Model field name | Description | Model field type |\n+===================+==============+===================+\n| ``user`` | Instance of | ``ForeignKey`` |\n| | the ``User`` | |\n| | model if | |\n| | authenticate | |\n| | d, | |\n| | ``None`` | |\n| | otherwise | |\n+-------------------+--------------+-------------------+\n| ``session`` | User browser | ``ForeignKey`` |\n| | session, | |\n| | instance of | |\n| | the | |\n| | ``Session`` | |\n| | model | |\n+-------------------+--------------+-------------------+\n| ``ip_address`` | User IP | ``CharField`` |\n+-------------------+--------------+-------------------+\n| ``date`` | User | ``DateTimeField`` |\n| | activity | |\n| | date and | |\n| | time | |\n+-------------------+--------------+-------------------+\n| ``path`` | User | ``CharField`` |\n| | activity | |\n| | path | |\n+-------------------+--------------+-------------------+\n| ``referer`` | User | ``CharField`` |\n| | activity | |\n| | referer | |\n+-------------------+--------------+-------------------+\n\n.. figure:: https://trello-attachments.s3.amazonaws.com/5841a8e7863eaf470b1e5d57/585d6cb3d8336749a4162b7f/c6717d6623b04b3f791718c88e9f21a1/Screen_Shot_2016-12-27_at_10.15.08.png\n :alt: Accessing logs from the Django shell\n\n Accessing logs from the Django shell\n\nDjaffar also adds the ``SessionInfo`` model, linked to the ``Session``\nmodel through a foreign key, with the following properties:\n\n+--------------------+-------------------------------------+--------------------+\n| Model field name | Description | Model field type |\n+====================+=====================================+====================+\n| ``user_agent`` | User agent of the browser session | ``CharField`` |\n+--------------------+-------------------------------------+--------------------+\n\nYou can get JSON dumps of the activity logs and the session info with\nDjango's standard ``dumpdata`` command:\n\n::\n\n python manage.py dumpdata djaffar.Activity --indent=2 > djaffar-activity.json\n python manage.py dumpdata djaffar.SessionInfo --indent=2 > djaffar-sessioninfo.json\n\nAppendix\n--------\n\nAbout sessions\n~~~~~~~~~~~~~~\n\nDjaffar uses `Django\nsessions `__\nto keep track of browser sessions when logging user activity. Depending\non settings, sessions either expire when the user closes their browser\nor after a given age (see `Browser-length sessions vs. persistent\nsessions `__).\n\nWhether your app uses session-based user authentication or not, Djaffar\nuses session (and the associated user agent) for two reasons:\n\n- Allowing you to distinguish between anonymous visitors\n- Allowing you to distinguish between visits by the same authenticated\n user through various devices\n\nTests\n-----\n\nRun tests (``tests/tests.py``) against the supported versions of Python\nand the required packages, as listed in ``tox.ini``:\n\n::\n\n tox\n\n.. |Build Status| image:: https://travis-ci.org/arnaudrenaud/django-djaffar.svg?branch=master\n :target: https://travis-ci.org/arnaudrenaud/django-djaffar\n.. |PyPI version| image:: https://badge.fury.io/py/django-djaffar.svg\n :target: https://badge.fury.io/py/django-djaffar", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/arnaudrenaud/django-djaffar/tarball/0.1.10", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/arnaudrenaud/django-djaffar", "keywords": "", "license": "BSD License", "maintainer": "", "maintainer_email": "", "name": "django-djaffar", "package_url": "https://pypi.org/project/django-djaffar/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-djaffar/", "project_urls": { "Download": "https://github.com/arnaudrenaud/django-djaffar/tarball/0.1.10", "Homepage": "https://github.com/arnaudrenaud/django-djaffar" }, "release_url": "https://pypi.org/project/django-djaffar/0.1.10/", "requires_dist": [ "Django (>=1.8)", "djangorestframework (>=3.3)", "python-dateutil (>=2.6)" ], "requires_python": "", "summary": "An asynchronous user activity tracking API for Django.", "version": "0.1.10" }, "last_serial": 2553418, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "350eded66a22ca58336a5fc55aa3ebbd", "sha256": "a526a4aea4f73a07a562ce9486e2761f70aa67ef47c8ac516f8eb4571b840aee" }, "downloads": -1, "filename": "django_djaffar-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "350eded66a22ca58336a5fc55aa3ebbd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13424, "upload_time": "2016-12-27T08:37:48", "url": "https://files.pythonhosted.org/packages/32/2d/928781096db3b9c2ab5914473d2e252b758afca03cc6c1b9c82e774ebd6f/django_djaffar-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6f9385c35fe5bfa1d4ed8db3cbf2cfd2", "sha256": "3e1dd941f41092dd064ddfe7a18b02ba4bfb981485fcd507298a6986fa776450" }, "downloads": -1, "filename": "django-djaffar-0.1.0.tar.gz", "has_sig": false, "md5_digest": "6f9385c35fe5bfa1d4ed8db3cbf2cfd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7023, "upload_time": "2016-12-27T08:37:50", "url": "https://files.pythonhosted.org/packages/62/f7/3332c27ceb2918056ef95029a30db8c306ddbd5eb6a85040f5214680ee50/django-djaffar-0.1.0.tar.gz" } ], "0.1.10": [ { "comment_text": "", "digests": { "md5": "e56cb8754148649cda9006cd38cc2cf5", "sha256": "fb179bb19addcb6efb3953b0ef9d8502e6a0e79ddd7a1b398464804ce3ce5e0d" }, "downloads": -1, "filename": "django_djaffar-0.1.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e56cb8754148649cda9006cd38cc2cf5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20982, "upload_time": "2017-01-04T11:28:55", "url": "https://files.pythonhosted.org/packages/6c/f2/dd52c0462127faaf5a41936c43e89d8da8337a9b20a9940a03e9936d02b7/django_djaffar-0.1.10-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9cadd9ed723064487ab8e8e34b3b02cb", "sha256": "afde1e4b813896157d5b6df110f25b21141ba66edd2f1d56f1b94925dc52c3cc" }, "downloads": -1, "filename": "django-djaffar-0.1.10.tar.gz", "has_sig": false, "md5_digest": "9cadd9ed723064487ab8e8e34b3b02cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7706, "upload_time": "2017-01-04T11:28:58", "url": "https://files.pythonhosted.org/packages/57/35/fc0a40a9646466196952240c4154c54d5586fd0c739be4347d003dcbeb41/django-djaffar-0.1.10.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c6dc379a38f09cb8d236c9add1c56860", "sha256": "5cf03d8ec8afec4be4aee68e08aae735bf14f0384c85120b2e311ba4bc6e3a83" }, "downloads": -1, "filename": "django_djaffar-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c6dc379a38f09cb8d236c9add1c56860", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13964, "upload_time": "2016-12-27T09:31:00", "url": "https://files.pythonhosted.org/packages/68/73/51423cd2c31babf6c6d069f2c7047a14fc582a4a27954fbfa1983621f852/django_djaffar-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "dfe52c384bff7d743f3b74735c7423ac", "sha256": "810327c21b81cefc3e4e4da8980540ced46c4f24122677eb868f66b3fb548dc2" }, "downloads": -1, "filename": "django-djaffar-0.1.5.tar.gz", "has_sig": false, "md5_digest": "dfe52c384bff7d743f3b74735c7423ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6047, "upload_time": "2016-12-27T09:31:03", "url": "https://files.pythonhosted.org/packages/dc/ec/1009b3c94c1f83f25924c5806f39843c0e8a8a99f01de8adaf8d761710dd/django-djaffar-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "341c9b9096c8c0127e0b4c41b6fedc3c", "sha256": "48fb52c6bfcd01c28e358926491cbc225c3cabfc5b5b50a41d43e7890a875714" }, "downloads": -1, "filename": "django_djaffar-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "341c9b9096c8c0127e0b4c41b6fedc3c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 14002, "upload_time": "2016-12-27T09:38:01", "url": "https://files.pythonhosted.org/packages/7d/36/74372cb8639c3fa1f9dce3497610dc60ee4a8272ada233a36a0763fb2feb/django_djaffar-0.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "752810467d62fd2c83805bff8537374a", "sha256": "63b0225e825b9c7d4709bce22c77eee56f4b8d835ab7a32d58af3e7dcaf1ad2c" }, "downloads": -1, "filename": "django-djaffar-0.1.6.tar.gz", "has_sig": false, "md5_digest": "752810467d62fd2c83805bff8537374a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6080, "upload_time": "2016-12-27T09:38:03", "url": "https://files.pythonhosted.org/packages/82/3c/cd56811019aae4b255ff643bdc17b542e2582fc0a45cf8825bfa91979311/django-djaffar-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "0c32bef7713c300b26959d77698412ce", "sha256": "3908f194a64b090d8dc438a366d70441bf5e8643bba86040fe6ed1eef0c17ff2" }, "downloads": -1, "filename": "django_djaffar-0.1.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c32bef7713c300b26959d77698412ce", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15834, "upload_time": "2016-12-29T08:27:06", "url": "https://files.pythonhosted.org/packages/6c/35/b6514ed20764175468bbfedf084ba956d84f339e61980174b54218d97304/django_djaffar-0.1.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8c1ea96a3bde8e2220e8f550d9e24c27", "sha256": "cccf34ae23a9523297486c406766f89b9fcba5b1940211ebcdd6cffb93ab1b2e" }, "downloads": -1, "filename": "django-djaffar-0.1.7.tar.gz", "has_sig": false, "md5_digest": "8c1ea96a3bde8e2220e8f550d9e24c27", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7496, "upload_time": "2016-12-29T08:27:09", "url": "https://files.pythonhosted.org/packages/4e/8b/5b1c4fa341d390634f366ad9d870644cf67234f943feb3150bd4aae21ce1/django-djaffar-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "d9484d2bb062f6ca0ea803f34ef153e5", "sha256": "2aa929d1d5043a2da945c4b5735f3a8daee4575d79f8668ad0cc7541dafc33dc" }, "downloads": -1, "filename": "django_djaffar-0.1.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d9484d2bb062f6ca0ea803f34ef153e5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 15840, "upload_time": "2016-12-29T08:34:40", "url": "https://files.pythonhosted.org/packages/95/eb/9bad7aee65161850b1dadcee7ede41fa2bf55457a9e68c2beb1abbb153b1/django_djaffar-0.1.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "361de2ed63305bad37cabebd34992942", "sha256": "a000a5afd35c322e591384286edcfa2b3531f14e4f6378f2cb9921ba687175b0" }, "downloads": -1, "filename": "django-djaffar-0.1.8.tar.gz", "has_sig": false, "md5_digest": "361de2ed63305bad37cabebd34992942", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7502, "upload_time": "2016-12-29T08:34:43", "url": "https://files.pythonhosted.org/packages/1b/d8/265c6ebe89528e9c82fd493075253aca054d1d325f8fbb800e51f27dbe8d/django-djaffar-0.1.8.tar.gz" } ], "0.1.9": [ { "comment_text": "", "digests": { "md5": "ee601edf53deb9c2dbb039124c8983b7", "sha256": "688f3c87f2399f624655878b43a9750ba22b221de45f5ab3e5c54ba22b8ab13c" }, "downloads": -1, "filename": "django_djaffar-0.1.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ee601edf53deb9c2dbb039124c8983b7", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20967, "upload_time": "2017-01-04T11:15:18", "url": "https://files.pythonhosted.org/packages/12/20/24a4fb817326a744de7ba0602354a88607435456592eea6e4259ef5d92ec/django_djaffar-0.1.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "388c4c7ce5df4f366ac77de7a972519e", "sha256": "19c36028f46676da2f26e7d98571487859c1dca0595d05f4233bc0c9f705e998" }, "downloads": -1, "filename": "django-djaffar-0.1.9.tar.gz", "has_sig": false, "md5_digest": "388c4c7ce5df4f366ac77de7a972519e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7707, "upload_time": "2017-01-04T11:15:20", "url": "https://files.pythonhosted.org/packages/98/47/30d3c9eecdc569102e21ce1e5f03ac7ee42122b427f4c4be1a1ee82b027c/django-djaffar-0.1.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e56cb8754148649cda9006cd38cc2cf5", "sha256": "fb179bb19addcb6efb3953b0ef9d8502e6a0e79ddd7a1b398464804ce3ce5e0d" }, "downloads": -1, "filename": "django_djaffar-0.1.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e56cb8754148649cda9006cd38cc2cf5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 20982, "upload_time": "2017-01-04T11:28:55", "url": "https://files.pythonhosted.org/packages/6c/f2/dd52c0462127faaf5a41936c43e89d8da8337a9b20a9940a03e9936d02b7/django_djaffar-0.1.10-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9cadd9ed723064487ab8e8e34b3b02cb", "sha256": "afde1e4b813896157d5b6df110f25b21141ba66edd2f1d56f1b94925dc52c3cc" }, "downloads": -1, "filename": "django-djaffar-0.1.10.tar.gz", "has_sig": false, "md5_digest": "9cadd9ed723064487ab8e8e34b3b02cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7706, "upload_time": "2017-01-04T11:28:58", "url": "https://files.pythonhosted.org/packages/57/35/fc0a40a9646466196952240c4154c54d5586fd0c739be4347d003dcbeb41/django-djaffar-0.1.10.tar.gz" } ] }