django-simplekeys/simplekeys/tests/views.py

24 lines
459 B
Python
Raw Permalink Normal View History

2024-12-17 05:04:51 +00:00
"""
views only for test purposes
"""
from django.http import JsonResponse
from simplekeys.decorators import key_required
@key_required()
def example(request):
return JsonResponse({'response': 'OK'})
@key_required(zone='special')
def special(request):
return JsonResponse({'response': 'special'})
def via_middleware(request):
return JsonResponse({'response': 'OK'})
def unprotected(request):
return JsonResponse({'response': 'OK'})