djangosnippets.org: Latest snippets tagged with 'IP'https://djangosnippets.org/tags/ip_1/2011-02-16T04:48:38.100782-06:00IP Authorization Decorator with IP list
2011-02-16T04:48:38.100782-06:00janstahttps://djangosnippets.org/snippets/2358/<p>Improved version of http://djangosnippets.org/snippets/2205/
</p>
<p>Example simple code:
`
from django.http import HttpResponse
IP_LIST = ['192.168.101.100', '192.168.101.220', '127.0.0.1', '127.0.1.1']
</p>
<p>@ip_auth(IP_LIST)
def get_parameter(request,name):
parameter = get_object_or_404(Parameter,short_name=short_name)
return HttpResponse(parameter.value)
</p>
<p>`
</p>
Freely redistributableIP Authorisation Decorator
2010-09-23T17:07:43.554160-05:00pliskinhttps://djangosnippets.org/snippets/2205/<p>Simple decorator definition to authorize particular IPs access to a view function.</p>
Freely redistributable