I'm trying to protect my remote server file system from unauthorized users. I have a remote storage on a different server that store and process PDF's and PNG's from all kind of processes.
I'm using Python 2.7 with Django 1.8 and Django Rest Framework.
I trying to implement very basic, "Proxy Layer" that will give my control on who ever use file system.
This is my view.py
:
from django.conf import settings
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import permissions
import requests
class Reports(APIView):
permission_classes = (permissions.AllowAny,) #Thats only for now...
def get(self, request, ssn, validity, file):
response = requests.get(settings.PROXY_BASE_URL + "/reports/" + ssn + "/" + validity + "/" + file)
return Response(response)
This concept works for any other GET
POST
PUT
DELETE
request that is text based response (For example json response from the remote server).
My problem is when I call this view, I get in the browser the default REST method definition page.