def process_response(self, request, response):
        response['X-Api-Discovery'] = request.build_absolute_uri(reverse('api-root'))

        if self.is_api_request(request):

            if settings.MZN_API_CORS_ORIGIN_ALLOW_ALL:
                response['Access-Control-Allow-Origin'] = '*'

            if request.method == 'OPTIONS':
                response['Access-Control-Allow-Headers'] = ', '.join(settings.MZN_API_CORS_ALLOW_HEADERS)
                response['Access-Control-Allow-Methods'] = ', '.join(settings.MZN_API_CORS_ALLOW_METHODS)

        return response
Add the CORS headers and API discovery header for clients
dataset/ETHPy150Open gcushen/mezzanine-api/mezzanine_api/middleware.py/ApiMiddleware.process_response