You've already forked STARK
mirror of
https://github.com/MarkParker5/STARK.git
synced 2025-07-02 22:36:54 +02:00
add SmartHome models for db
This commit is contained in:
16
Controls/Django/api/methods.py
Normal file
16
Controls/Django/api/methods.py
Normal file
@ -0,0 +1,16 @@
|
||||
from django.http import HttpResponse, FileResponse
|
||||
from django.views.decorators.http import require_http_methods
|
||||
from django.shortcuts import render
|
||||
|
||||
|
||||
# decorator
|
||||
def require_mobile_app(methods):
|
||||
def decorator(function):
|
||||
@require_http_methods(methods)
|
||||
def wrapper(request):
|
||||
if config.debug or request.META.get('HTTP_USER_AGENT') == 'ArchieMobile':
|
||||
return function(request)
|
||||
else:
|
||||
return HttpResponse(status = 444)
|
||||
return wrapper
|
||||
return decorator
|
Reference in New Issue
Block a user