私はこのコードを持っています
class DownloadView(TemplateView):
template_name = 'pdfform/create_form2.html'
def serve_pdf(self, request):
#pdf_data = magically_create_pdf()
response = HttpResponse(mimetype='application/pdf')
response['Content-Disposition'] = 'attachment; filename="http://localhost/static/pdfs/angular.pdf"'
return response
そのページに移動すると、ダウンロード ダイアログが表示されますが、ファイルをダウンロードできません。それは言う
http 403 forbidden
今、私はファイルに直接アクセスできますが、http://localhost/static/pdfs/angular.pdf
それをブラウザに入れます
私は入れ てみましstatic/pdfs/angular.pdf
たが、同じエラーです