Data exchange network in Uzbekistan, where many domestic ISP providers give access to resources within the network to their subscribers for free.
Simple django app to block non-tasix ip adresses.
- Python (3.2, 3.3, 3.4, 3.5)
- Django (1.10)
Install using pip
:
pip install django-tasix
There are 2 ways for using this app:
- Middleware style (blocks every request outside Tas-IX)
- Decorator style (blocks certain requests outside Tas-IX)
Add 'tasix.middleware.TasixMiddleware'
to your MIDDLEWARE_CLASSES
setting:
MIDDLEWARE_CLASSES = (
# other middleware classes
'tasix.middleware.TasixMiddleware',
)
Import allow_tasix
decorator in your view
from django.http import HttpResponse
from tasix.decorators import allow_tasix
@allow_tasix
def index_view(request):
return HttpResponse('Only Tas-IX users can view this')
Running tests
If you are using a virtualenv, all you need to do is:
$ make test
Network range is being fetched manually from http://tasix.sarkor.uz/full
, meaning correctness is based on 3rd party ISP provider which releases network information periodically.
BSD