Simple django app to allow/block IP addresses and ranges outside the Tas-IX network
Project description
# django-tasix
[![Build
Status](https://travis-ci.org/muminoff/django-tasix.svg?branch=master)](https://travis-ci.org/muminoff/django-tasix)
## What is Tas-IX?
Data exchange network in Uzbekistan, where many domestic ISP providers give access to resources within the network to their subscribers for free.
## What is `django-tasix`?
Simple django app to detect ip adresses/ranges of coming HTTP requests in middleware layer.
# Requirements
* Python (3.2, 3.3, 3.4, 3.5)
* Django (1.10)
# Installation
Install using `pip`:
pip install django-tasix
There are 2 ways for using this app:
1. Middleware style (blocks every request outside Tas-IX)
2. Decorator style (blocks certain requests outside Tas-IX)
### Middleware style
Add `'tasix'` to your `MIDDLEWARE_CLASSES` setting:
MIDDLEWARE_CLASSES = (
# other middleware classes
'tasix.middleware.TasixMiddleware',
)
### Decorator style
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')
## Disclaimer
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.
## License
BSD
[![Build
Status](https://travis-ci.org/muminoff/django-tasix.svg?branch=master)](https://travis-ci.org/muminoff/django-tasix)
## What is Tas-IX?
Data exchange network in Uzbekistan, where many domestic ISP providers give access to resources within the network to their subscribers for free.
## What is `django-tasix`?
Simple django app to detect ip adresses/ranges of coming HTTP requests in middleware layer.
# Requirements
* Python (3.2, 3.3, 3.4, 3.5)
* Django (1.10)
# Installation
Install using `pip`:
pip install django-tasix
There are 2 ways for using this app:
1. Middleware style (blocks every request outside Tas-IX)
2. Decorator style (blocks certain requests outside Tas-IX)
### Middleware style
Add `'tasix'` to your `MIDDLEWARE_CLASSES` setting:
MIDDLEWARE_CLASSES = (
# other middleware classes
'tasix.middleware.TasixMiddleware',
)
### Decorator style
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')
## Disclaimer
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.
## License
BSD
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
django-tasix-0.3.0.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file django-tasix-0.3.0.tar.gz
.
File metadata
- Download URL: django-tasix-0.3.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60795f3001f042ca7a27601c9371e810d3f13605ef4e45f0a710b1827c3ff7ab |
|
MD5 | c087c0ab14411c6ee099055474f984a8 |
|
BLAKE2b-256 | 4f2bdb2bfeee331ad273709b4141ac73f100169b9153de6396de35561f73ee70 |
File details
Details for the file django_tasix-0.3.0-py3-none-any.whl
.
File metadata
- Download URL: django_tasix-0.3.0-py3-none-any.whl
- Upload date:
- Size: 6.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81f960a82f8c608a0693df6e235af9fa32b573fbc00f0e49c9e014af3125052b |
|
MD5 | d46a25d64c0eb95cd859fec4763bcf27 |
|
BLAKE2b-256 | d848384a7f00a9ec90907790c3b9374ae48d0f6b869f6eeeade07fea9a082e0a |