{ "info": { "author": "Lawrence Weikum", "author_email": "lawrencemq@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "django-online-users\n===================\n\nTracks the time of each user's last action\n\nUsing middleware, django-online-users will keep track of each user and the timestamp of their last action in the database.\n\nAdmins can see this data in the admin portal, and the database can be queried using timedeltas.\n\nThis is meant for smaller applications as each HTTP request will result in a database entry update.\n\nRequirements\n------------\n\n- Python: 2.7, 3.3, 3.4, 3.5, 3.6\n- Django: 1.10+\n\n\nSetup\n-----------\n\n1. Add \"online_users\" to your ``INSTALLED_APPS``\n\n\n.. code-block:: python\n\n INSTALLED_APPS = [\n ...\n 'online_users',\n ]\n\n\n2. Add the ``OnlineNowMiddleware`` to your ``MIDDLEWARE_CLASSES`` after the ``SessionMiddleware``\n\n\n.. code-block:: python\n\n MIDDLEWARE_CLASSES = (\n ...\n 'online_users.middleware.OnlineNowMiddleware',\n )\n\n\n3. Run ``python manage.py migrate`` to create the tables in the database.\n\nUse\n---\n\n* The time of the last action for each user can be seen in the admin portal at http://127.0.0.1:8000/admin/online_users/onlineuser/\n\n\n* To retrieve the current number of users online in the last 15 minutes\n\n\n.. code-block:: python\n\n from datetime import timedelta\n ...\n user_activity_objects = OnlineUserActivity.get_user_activities()\n number_of_active_users = user_activity_objects.count()\n\n\n* A timedelta can also be specified to the ``get_user_activities()`` with to find activity\n\n\n.. code-block:: python\n\n from datetime import timedelta\n ...\n user_activity_objects = OnlineUserActivity.get_user_activities(timedelta(minutes=60)\n users = (user for user in user_activity_objects)\n\n\nAPI\n---\n\nOnlineUserActivity holds two values: `user`, the user in question, and `last_activity`, a timestamp stored as a DateTimeField.\n\n``OnlineUserActivity.get_user_activities()`` will return OnlineUserActivity objects for the last 15 minutes by default.\nDevelopers can also pass in a time delta of a different length of time for the query. The response is a QuerySet containing\nthe active users during that time period, and the items are sorted in descending chronological order.", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lawrencemq/django-online-users", "keywords": null, "license": "MIT License", "maintainer": null, "maintainer_email": null, "name": "django-online-users", "package_url": "https://pypi.org/project/django-online-users/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-online-users/", "project_urls": { "Homepage": "https://github.com/lawrencemq/django-online-users" }, "release_url": "https://pypi.org/project/django-online-users/0.1/", "requires_dist": null, "requires_python": null, "summary": "Tracks the time of users' last actions.", "version": "0.1" }, "last_serial": 2875885, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "43729f0c5a7d1b9a6db767240c83beef", "sha256": "26f6ecadb16057a29898e1219b86bddaec027c9fe4c2abcc037267034ea7e5ee" }, "downloads": -1, "filename": "django_online_users-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "43729f0c5a7d1b9a6db767240c83beef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8503, "upload_time": "2017-01-06T16:50:30", "url": "https://files.pythonhosted.org/packages/fe/ad/9cf0c2fe3acb0d9d782b01bc136d28a117d606d0806d5b60caa2cff5c860/django_online_users-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e77d472b45e98535aad8b711bf5c7319", "sha256": "6d9a82cd60d97eeb20ec2c12712c4ea16f0fcbe322217d5cab783c64c6ede147" }, "downloads": -1, "filename": "django-online-users-0.1.tar.gz", "has_sig": false, "md5_digest": "e77d472b45e98535aad8b711bf5c7319", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5387, "upload_time": "2017-01-06T16:50:31", "url": "https://files.pythonhosted.org/packages/ea/e3/017e5e08e0619127b1f49fc9993c253f0ef7d759996c67f0472036417fa4/django-online-users-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "8cefb688f4805e91b1737d5df8502de8", "sha256": "04906a4a580bb0574fb34d73afd6f2938816ff8fef62431399ee4561d37df76c" }, "downloads": -1, "filename": "django_online_users-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "8cefb688f4805e91b1737d5df8502de8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9173, "upload_time": "2017-05-15T16:29:19", "url": "https://files.pythonhosted.org/packages/4c/ca/59f65d32be134b2eea6ea89cbdba605cbbd6be005a5bda53a83820f601a6/django_online_users-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26f2e5aab349e0c42f45942a70eecdbb", "sha256": "d235040c1f2b76739b742c7a70c78f602c1faa6d084ea6b22782ef84b9289793" }, "downloads": -1, "filename": "django_online_users-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "26f2e5aab349e0c42f45942a70eecdbb", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9173, "upload_time": "2017-05-15T16:29:01", "url": "https://files.pythonhosted.org/packages/8c/f3/83ad96a0b6b840d282abe38dcd89e8338072ed1f3ebc7b28f304cc18baa5/django_online_users-0.3-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "43729f0c5a7d1b9a6db767240c83beef", "sha256": "26f6ecadb16057a29898e1219b86bddaec027c9fe4c2abcc037267034ea7e5ee" }, "downloads": -1, "filename": "django_online_users-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "43729f0c5a7d1b9a6db767240c83beef", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 8503, "upload_time": "2017-01-06T16:50:30", "url": "https://files.pythonhosted.org/packages/fe/ad/9cf0c2fe3acb0d9d782b01bc136d28a117d606d0806d5b60caa2cff5c860/django_online_users-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e77d472b45e98535aad8b711bf5c7319", "sha256": "6d9a82cd60d97eeb20ec2c12712c4ea16f0fcbe322217d5cab783c64c6ede147" }, "downloads": -1, "filename": "django-online-users-0.1.tar.gz", "has_sig": false, "md5_digest": "e77d472b45e98535aad8b711bf5c7319", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5387, "upload_time": "2017-01-06T16:50:31", "url": "https://files.pythonhosted.org/packages/ea/e3/017e5e08e0619127b1f49fc9993c253f0ef7d759996c67f0472036417fa4/django-online-users-0.1.tar.gz" }, { "comment_text": "", "digests": { "md5": "8cefb688f4805e91b1737d5df8502de8", "sha256": "04906a4a580bb0574fb34d73afd6f2938816ff8fef62431399ee4561d37df76c" }, "downloads": -1, "filename": "django_online_users-0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "8cefb688f4805e91b1737d5df8502de8", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 9173, "upload_time": "2017-05-15T16:29:19", "url": "https://files.pythonhosted.org/packages/4c/ca/59f65d32be134b2eea6ea89cbdba605cbbd6be005a5bda53a83820f601a6/django_online_users-0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "26f2e5aab349e0c42f45942a70eecdbb", "sha256": "d235040c1f2b76739b742c7a70c78f602c1faa6d084ea6b22782ef84b9289793" }, "downloads": -1, "filename": "django_online_users-0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "26f2e5aab349e0c42f45942a70eecdbb", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9173, "upload_time": "2017-05-15T16:29:01", "url": "https://files.pythonhosted.org/packages/8c/f3/83ad96a0b6b840d282abe38dcd89e8338072ed1f3ebc7b28f304cc18baa5/django_online_users-0.3-py3-none-any.whl" } ] }