{"repo":"pysnippet/django-forbid","free":true,"listed":false,"github":"https://github.com/pysnippet/django-forbid","clone":"git clone https://github.com/pysnippet/django-forbid.git","description":"Secure your Django app by controlling the access - grant or deny user access based on device and location, including VPN detection.","language":"Python","stars":68,"topics":["django","forbid","python","django-forbid","access","device","location","permit","country","territory"],"license":"MIT","category":"networking-infra","readme_excerpt":"Django Forbid Django Forbid aims to make website access managed and secure for the maintainers. It provides a middleware to grant or deny user access based on device and/or location. It also supports VPN detection for banning users who want to lie about their country and geolocation. Also, users can use only the VPN detection feature or disable it. Installation Configuration Add the django forbid.apps.ForbidConfig to your INSTALLED APPS in your Django project's settings.py file. Also, add the django forbid.middleware.ForbidMiddleware to the MIDDLEWARE list of the project. Configuring the GEOIP PATH variable in your project's settings is important. This variable should contain the path to the GeoLite2 database file. You should download the database and follow the Django documentation for proper configuration. Usage After connecting the Django Forbid to your project, you can define the set of desired zones to be forbidden or allowed. All you need is to set the DJANGO FORBID variable in your project's settings. It should be a dictionary with the following keys: - DEVICES - list of devices to permit or forbid access to - COUNTRIES - list of countries to permit or forbid access to - TERRITORIES - list of territories to permit or forbid access to - OPTIONS - a dictionary for additional settings - VPN - use VPN detection and forbid access to VPN users - URL - set of URLs to redirect to when the user is located in a forbidden country or using a VPN - FORBIDDEN LOC - the URL to redire","default_branch":null,"files":null,"tree":[],"storefront":"/r/pysnippet","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/pysnippet/django-forbid/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}