{ "info": { "author": "Leszek Andrzej Ko\u0142acz", "author_email": "lkolacz@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Topic :: Security", "Topic :: System :: Monitoring" ], "description": "Django Geolocation Alert\n========================\n\nDjango Geolocation Alert is an middleware that control user IP address\nand agent browser during session time. If someone will take session id \nand try to use it from another IP or different agent browser Alert will raise\nso user will be logged out with alert messages.\nYou can also turn on send signal to make some custom staff by handling it.\nLot of User class that can be authenticated? Don't worry take a look below.\n\nThe app integrates smoothly with any Django project.\nAll You need to do is install app and add middleware to MIDDLEWARE_CLASSES\nin settings. Please read Quick start to know hot to do that.\n\n\nFeatures\n--------\n\n* Set geolocation user hash to request.session when user_logged_in signal is send\n* Define User model(s) class that geolocation alert should raise\n* Send geolocation alert as signal if User IP or agent browser will change and logout\n* Override settings if needed\n\nFuture Features\n---------------\n\n* Confirm it works on django 1.7\n* PY2 & PY3 compabilities\n* Django downgrade compabilities 1.6, 1.5, 1.4\n* unit tests\n\nRequirements\n------------\n\n* Django == 1.8\n* Python == 2.7\n\nLicense\n-------\n\nMIT\n\nQuick Start\n-----------\n\nInstall django-geolocation-alert in your system by command::\n\n pip install django-geolocation-alert\n\nThen use it in a django project by putting middleware to Your settings::\n\n MIDDLEWARE_CLASSES = (\n ..\n 'geolocation.middleware.GeolocationMiddleware'\n )\n\nNow it's works :)\n\nMore custom? Ok, lets handle alert signals!\n\n1. Make some function::\n\n def alert_geolocation_handler(sender, request, user, **kwargs):\n # do some staff\n # deactivate User and force SMS code send to confirm identity\n ..\n\n2. Connect Your function with signal::\n\n from geolocation.signal import geo_alert_occurred\n geo_alert_occurred.connect(alert_geolocation_handler)\n # I suggest connect it inside \"basic app_module.views.py\"\n # make sure that geo_alert_occurred.has_listeners() is True\n\n3. Last step -> Turn On send alert signal in your prj settings::\n\n GEOLOCATION_SEND_SIGNAL = True\n\n\ndjango.conf.settings\n--------------------\n\nOverride some of them if needed.\n\n\n**GEOLOCATION_HASH**\n\nDefault session key name that storage geolocation hash is 'geolocation_hash'.\nIf for any reason You want it to change, go straight ahead.\n\n**GEOLOCATION_SEND_SIGNAL**\n\nDefault is set to False, but if you need to do some staff with this event\njust turn it on and make some handler for your purpose.\n\n**GEOLOCATION_SEND_MSG**\n\nDefault is set to None. This will add standard messages (django.contrib.messages)\nas an messages.WARNING mode with text::\n\n IP address or agent browser change during session time, after log on.\n\nIf You want set different message just set it in prj settings::\n\n from django.utils.translation import ugettext_lazy as _\n GEOLOCATION_SEND_MSG = _('You bastard!!! I got you!!!')\n\nOr turn it off by::\n\n GEOLOCATION_SEND_MSG = False\n\n**GEOLOCATION_USER_MODELS**\n\nDefault is None. Please change it if You have many users model classes which You\nwant to be handle by geolocation alert::\n\n GEOLOCATION_USER_MODELS = [\n \"auth.User\",\n \"panel.PanelUser\",\n \"merchant.MerchantUser\",\n \"buyer.BuyerUser\",\n \"account.GuestAccount\",\n ]\n\nNow if anybody will take session id and will try it from different IP\nor agent browser will be logged out. If there is different User class,\nnot noticed in the list it won't be handled by alert!\n\n**GEOLOCATION_IS_ACTIVE**\n\nDefault is set to True, but if You need to work on staging - for example,\nwith one admin for many users (testers and developers)\nit's useful to turn it off.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lkolacz/django-geolocation-alert.git", "keywords": "django geolocation middleware alert session hash IP agent browser", "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-geolocation-alert", "package_url": "https://pypi.org/project/django-geolocation-alert/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-geolocation-alert/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/lkolacz/django-geolocation-alert.git" }, "release_url": "https://pypi.org/project/django-geolocation-alert/0.5.1/", "requires_dist": null, "requires_python": null, "summary": "Geolocation django middleware that check if user IP or agent browser change during session time.", "version": "0.5.1" }, "last_serial": 1822949, "releases": { "0.5": [ { "comment_text": "", "digests": { "md5": "2a3a61db0d16f7fe221d9026c1ed0364", "sha256": "9e2c0f715a54a1fa3c57f7469724b302df7e877925e4e05a30be526231914441" }, "downloads": -1, "filename": "django-geolocation-alert-0.5.tar.gz", "has_sig": false, "md5_digest": "2a3a61db0d16f7fe221d9026c1ed0364", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5325, "upload_time": "2015-11-14T15:53:09", "url": "https://files.pythonhosted.org/packages/bd/aa/0c08f7cacffdb24e1e0fa8651acd246047209f25c36af9f7856f8b85c203/django-geolocation-alert-0.5.tar.gz" } ], "0.5.1": [ { "comment_text": "", "digests": { "md5": "6dca7b7eaf654880e746e6b88ee5da62", "sha256": "8908e11be8fdee1a72bc208e30db8ce46e48228be9755d64aebd380c049445b2" }, "downloads": -1, "filename": "django-geolocation-alert-0.5.1.tar.gz", "has_sig": false, "md5_digest": "6dca7b7eaf654880e746e6b88ee5da62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5166, "upload_time": "2015-11-18T17:27:14", "url": "https://files.pythonhosted.org/packages/fc/1b/efc99a8f56986d5721fe3800a3d72b3caa4966748a26734e0111d6431cff/django-geolocation-alert-0.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6dca7b7eaf654880e746e6b88ee5da62", "sha256": "8908e11be8fdee1a72bc208e30db8ce46e48228be9755d64aebd380c049445b2" }, "downloads": -1, "filename": "django-geolocation-alert-0.5.1.tar.gz", "has_sig": false, "md5_digest": "6dca7b7eaf654880e746e6b88ee5da62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5166, "upload_time": "2015-11-18T17:27:14", "url": "https://files.pythonhosted.org/packages/fc/1b/efc99a8f56986d5721fe3800a3d72b3caa4966748a26734e0111d6431cff/django-geolocation-alert-0.5.1.tar.gz" } ] }