Code: Alles auswählen
def handbuch(req):
with open('medien/handbuch.pdf', 'rb') as pdf:
response = HttpResponse(pdf.read(), content_type='application/pdf')
response['Content-Disposition'] = 'inline; filename="handbuch.pdf"'
return response
ergibt den Fehler
Code: Alles auswählen
[Errno 2] No such file or directory: 'medien/handbuch.pdf'