from django.shortcuts import render

# Create your views here.
class MultipleProxyMiddleware:
    FORWARDED_FOR_FIELDS = [
        'HTTP_X_FORWARDED_FOR',
        'HTTP_X_FORWARDED_HOST',
        'HTTP_X_FORWARDED_SERVER',
    ]

    def __init__(self, get_response):
        self.get_response = get_response

    def __call__(self, request):
        """
        Rewrites the proxy headers so that only the most
        recent proxy is used.
        """
        for field in self.FORWARDED_FOR_FIELDS:
            if field in request.META:
                if ',' in request.META[field]:
                    parts = request.META[field].split(',')
                    request.META[field] = parts[-1].strip()
        return self.get_response(request)

def index(request):

    context = {
      
    }
    template_name = 'pages/app/index.html'
    return render(request, template_name, context)
    

[((32, 11, 32, 50), 'django.shortcuts.render', 'render', ({(32, 18, 32, 25): 'request', (32, 27, 32, 40): 'template_name', (32, 42, 32, 49): 'context'}, {}), '(request, template_name, context)', False, 'from django.shortcuts import render\n')]