Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Sardor Muminov committed Oct 18, 2016
1 parent b7d1876 commit 9f24c4a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,37 @@ Simple django app to detect ip adresses/ranges of coming HTTP requests in middle

# Installation

Install using '`pip`':
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.

Expand Down

0 comments on commit 9f24c4a

Please sign in to comment.