Login

Tag "Authorization"

Snippet List

IP Authorization Decorator with IP list

Improved version of http://djangosnippets.org/snippets/2205/ 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'] @ip_auth(IP_LIST) def get_parameter(request,name): parameter = get_object_or_404(Parameter,short_name=short_name) return HttpResponse(parameter.value) `

  • IP
  • Authorization
  • Decorator
Read More

1 snippet posted so far.