Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
Outputting HDF5 file using Django framework

I'm making a website using the Django framework. I've successfully gotten a web app that takes user data, uses that to make a query, and the outputs a CSV file. However, what I'd really like is to output an HDF5 file. I googled around and there doesn't seem to be any documentation on outputting an HD5F file from a Django web app. I tried adapting the Django example of outputting a PDF (https://docs.djangoproject.com/en/1.10/howto/outputting-pdf/) like this,

response = HttpResponse(content_type='application/hdf5')
response['Content-Disposition'] = 'attachment; filename="test.hdf5"'

h = h5py.File(response)
h.create_dataset('Name', data=test[0].name)

but I get an error,

'HttpResponse' object has no attribute 'encode'

So I guess I'm misunderstanding how to use content_type in Django's HttpResponse. Does anybody have any experience with outputting HDF5 files form a Django web app or could help clarify how I might adapt the HttpResponse to work with HDF5?

Thank you.

about 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!