I need to return css files and js files according to specific logic. Clearly, static serve does not perform what I need. I have a view, whose render method uses logic to fin
This is what I used:
test_file = open('/home/poop/serve/test.pdf', 'rb') response = HttpResponse(content=test_file) response['Content-Type'] = 'application/pdf' response['Content-Disposition'] = 'attachment; filename="%s.pdf"' \ % 'whatever' return response