{ "info": { "author": "Nikita Ekaterinchuk", "author_email": "en.elloco@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "MONITORING OF DJANGO ACTIVE USERS\n=================================\n\n.. image:: https://img.shields.io/pypi/v/django-active-users.svg\n :target: https://pypi.python.org/pypi/django-active-users\n\n.. image:: https://travis-ci.org/n-elloco/django-active-users.svg?branch=master\n :target: https://travis-ci.org/n-elloco/django-active-users\n\n\n*Online monitoring of active users in Django using Redis*\n\nCollecting information about active users in the Django application\nfor last specified time interval, using Redis cache.\n\n\nRequirements\n------------\n\n- Python: 2.7, 3.3, 3.4, 3.5, 3.6\n- Django: 1.5+\n- Django-redis: 4.9.0\n 4.4.4 (for Django 1.5, 1.6 or Python 3.3)\n\n\nInstall\n-------\n\n.. code-block:: bash\n\n pip install django-active-users\n\n\nSetup\n-----\n\nYour django application should have a Redis cache setting.\nSee more in ``django-redis`` `official documentation `_. \n\nAdd ``active_users.middleware.ActiveUsersSessionMiddleware`` to your project's\n``MIDDLEWARE`` after the ``SessionMiddleware``.\n\n.. code-block:: python\n\n MIDDLEWARE = (\n ...\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'active_users.middleware.ActiveUsersSessionMiddleware',\n ...\n )\n\nFor applications with Django version earlier than 1.10 use ``MIDDLEWARE_CLASSES`` option\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = (\n ...\n 'django.contrib.sessions.middleware.SessionMiddleware',\n 'active_users.middleware.ActiveUsersSessionMiddleware',\n ...\n )\n\n\nSettings\n--------\n\n``ACTIVE_USERS_KEY_EXPIRE`` - Time of key expire (interval after the last request during which the visitor is considered active) in seconds. Default is 20.\n\n``ACTIVE_USERS_EXCLUDE_URL_PATTERNS`` - List of regular expressions for excluded URLs. If they are matched, the visitor (and pageview) key will not be create.\n\n``ACTIVE_USERS_KEY_CLASS`` - Class of visitor key entry. It should be a descendant of ``active_users.keys.AbstractActiveUserEntry``.\nDefault ``active_users.keys.ActiveUserEntry``. See more in `Custom dimensions in the keys`_\n\n\nAPI\n---\n\nYou can use API for getting information about active users.\nYou can also call methods from ``active_users.api`` module directly.\n\n**Methods:**\n\n- ``get_active_users_count`` - returns count of active users (users, who visited site for the last time interval,\n which is set by option ``ACTIVE_USERS_KEY_EXPIRE``)\n\n- ``get_active_users`` - returns list of dictionaries with information about active users;\n keys of dictionaries are set from field ``fields`` of entry class, which is set by option ``ACTIVE_USERS_KEY_CLASS``\n\n\nAlso, you can include special view in your Django application, adding the URL pattern to your ``urls.py`` file\n\n\n.. code-block:: python\n\n urlpatterns = [\n ...\n url(r'^active-users/', include('active_users.api.urls')),\n ...\n ]\n\n\nCustom dimensions in the keys\n-----------------------------\n\nBy default, 4 dimensions are saved in the keys (``user_id``, ``session_id``, ``IP``, ``username``).\nThis is provided by class ``ActiveUserEntry``, which inherits from abstract class ``AbstractActiveUserEntry``.\nYou can use your dimensions, defined in your own class, which should be a descendant of class ``AbstractActiveUserEntry`` and\nyou need to define the logic of using these dimensions in the class method ``create_from_request``.\n\nFor example, we need to save information about service, which makes request, and this information we can take\nfrom request header. Also, we want use all dimensions from class ``ActiveUserEntry``.\n\n\n.. code-block:: python\n\n from active_users.keys import ActiveUserEntry\n\n class OurActiveUserEntry(ActiveUserEntry):\n\n fields = ('service_id',) + ActiveUserEntry.fields\n\n @classmethod\n def create_from_request(cls, request):\n instance = super(OurActiveUserEntry, cls).create_from_request(request)\n instance.app_id = request.META.get('HTTP_SERVICE_ID', u'')\n return instance\n\n\nAt the end, we need to specify option ``ACTIVE_USERS_KEY_CLASS`` in the ``settings.py``.\n\n\n.. code-block:: python\n\n ACTIVE_USERS_KEY_CLASS = 'my_app.keys.OurActiveUserEntry'\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/n-elloco/django-active-users", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "django-active-users", "package_url": "https://pypi.org/project/django-active-users/", "platform": "", "project_url": "https://pypi.org/project/django-active-users/", "project_urls": { "Homepage": "https://github.com/n-elloco/django-active-users" }, "release_url": "https://pypi.org/project/django-active-users/0.2.2/", "requires_dist": [ "django (>=1.5)", "django-redis (>=4.4.4)", "six" ], "requires_python": "", "summary": "Monitoring of active users in Django using Redis", "version": "0.2.2" }, "last_serial": 3862452, "releases": { "0.0.1": [], "0.0.1.1": [ { "comment_text": "", "digests": { "md5": "a4df76d1dfd70b12e61947bb8ff98b04", "sha256": "ef7f4c2100d3ac39b108df839f351e91f33a98aa26b579ff3cf7be7b7b99b760" }, "downloads": -1, "filename": "django-active-users-0.0.1.1.tar.gz", "has_sig": false, "md5_digest": "a4df76d1dfd70b12e61947bb8ff98b04", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3816, "upload_time": "2016-03-04T04:36:36", "url": "https://files.pythonhosted.org/packages/ef/4d/6c2a53559b7399504948d67fa445e426520c17178694c0982fe37026eb58/django-active-users-0.0.1.1.tar.gz" } ], "0.0.1.2": [ { "comment_text": "", "digests": { "md5": "ee8440f8a3414bb10a1fe58e087a3513", "sha256": "9c83bbc82bd0fb18bd71e463ffcebf9e45ef14897789e44aec48148155543d20" }, "downloads": -1, "filename": "django-active-users-0.0.1.2.tar.gz", "has_sig": false, "md5_digest": "ee8440f8a3414bb10a1fe58e087a3513", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3915, "upload_time": "2016-03-10T10:05:09", "url": "https://files.pythonhosted.org/packages/7d/c1/233e21c954ddc72eb0a60b3fa1e5d2ac65f98277bdc4d018f739d1117995/django-active-users-0.0.1.2.tar.gz" } ], "0.0.1.3": [ { "comment_text": "", "digests": { "md5": "d1f63eaa06d2d7081035f2b4e599e028", "sha256": "9af2fcba14f369bbc68790917398e8c6dced7ff8ddedfa34e8699b6ae9f4f70d" }, "downloads": -1, "filename": "django-active-users-0.0.1.3.tar.gz", "has_sig": false, "md5_digest": "d1f63eaa06d2d7081035f2b4e599e028", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3933, "upload_time": "2016-04-12T05:58:53", "url": "https://files.pythonhosted.org/packages/27/f3/91476ebb0d3d731a71158d44993183390206e8608e2fb3636257fd427ee0/django-active-users-0.0.1.3.tar.gz" } ], "0.0.1.4": [ { "comment_text": "", "digests": { "md5": "250971ff4802b4ed52dd8a024d0d26cd", "sha256": "e526c5b8989d3fde5979b55d30a2c7a439978fc06281ad50e2abee33807776e4" }, "downloads": -1, "filename": "django_active_users-0.0.1.4-py2.7.egg", "has_sig": false, "md5_digest": "250971ff4802b4ed52dd8a024d0d26cd", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 7288, "upload_time": "2016-09-23T04:28:20", "url": "https://files.pythonhosted.org/packages/db/bd/aaca2856751d932ac488cf120f8b6b291be4d3fa3c92c0c14926e4446e2d/django_active_users-0.0.1.4-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "9a8b137283b80bc457f3df8f1f82b296", "sha256": "bcd03f41968170ae59b217b0de92c5faca529e63016e72c21f7832abcf27153b" }, "downloads": -1, "filename": "django_active_users-0.0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9a8b137283b80bc457f3df8f1f82b296", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4679, "upload_time": "2016-09-23T04:28:18", "url": "https://files.pythonhosted.org/packages/91/ce/2a1ad82748d532a9b8621a70c5e58d13420f93aab8306c97090ed1ff86b1/django_active_users-0.0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cfb6870c9d72cdd46c1ea928daadfadd", "sha256": "8ca722d6cdb4a6495f633b87e2078738b03e2ea4b5aba54641500d3268c2c6d9" }, "downloads": -1, "filename": "django-active-users-0.0.1.4.tar.gz", "has_sig": false, "md5_digest": "cfb6870c9d72cdd46c1ea928daadfadd", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3217, "upload_time": "2016-09-23T04:28:22", "url": "https://files.pythonhosted.org/packages/83/30/8cdeeb3b29f39172bd338abd9ebdf8983f0302633f1b7b8a586a2bd50928/django-active-users-0.0.1.4.tar.gz" } ], "0.1": [ { "comment_text": "", "digests": { "md5": "4bbee27beadf7285c629580451598186", "sha256": "d2eddc4e5cc1498e5a47960e320f75230b9d668cf1f9723ae2dfaf6afcb2b9f6" }, "downloads": -1, "filename": "django-active-users-0.1.tar.gz", "has_sig": false, "md5_digest": "4bbee27beadf7285c629580451598186", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5622, "upload_time": "2016-10-03T04:43:31", "url": "https://files.pythonhosted.org/packages/ed/1f/d69613e3a591ae585521589eb09686c85f737e1332cc23bc651fb5c0086b/django-active-users-0.1.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "e4251f76f99fb830cf627cc12238326f", "sha256": "2f9eacfc0d9764771cb54662311ace89a429c95fba006da99bc847f00c405f32" }, "downloads": -1, "filename": "django_active_users-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e4251f76f99fb830cf627cc12238326f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9010, "upload_time": "2018-05-07T15:43:57", "url": "https://files.pythonhosted.org/packages/0e/d6/ffdf60c3edf591e9f4230a61a02e1f5386c38f1c271b9b02e46e33d8e735/django_active_users-0.2.1-py2.py3-none-any.whl" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "9591df39a1a14c24e4412d5b1b3ef069", "sha256": "68fd1331c074cd15f0a2a2720e149746f2212aa2470cf9d97701ba808e5ed06b" }, "downloads": -1, "filename": "django_active_users-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9591df39a1a14c24e4412d5b1b3ef069", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6480, "upload_time": "2018-05-14T20:57:44", "url": "https://files.pythonhosted.org/packages/7d/7b/5ff91f1640eaedccd3c468381e698cd8032e22c94d14882c9669dc82884e/django_active_users-0.2.2-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9591df39a1a14c24e4412d5b1b3ef069", "sha256": "68fd1331c074cd15f0a2a2720e149746f2212aa2470cf9d97701ba808e5ed06b" }, "downloads": -1, "filename": "django_active_users-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "9591df39a1a14c24e4412d5b1b3ef069", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 6480, "upload_time": "2018-05-14T20:57:44", "url": "https://files.pythonhosted.org/packages/7d/7b/5ff91f1640eaedccd3c468381e698cd8032e22c94d14882c9669dc82884e/django_active_users-0.2.2-py2.py3-none-any.whl" } ] }