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

391
Views
Django - navigate hyperlink to a folder on disk

I would like to click on a hyperlink in my Django template that navigates to an arbitrary URL such as file:///C:/my_dir/folder, this URL works if I paste it directly into the address field of a browser, but does nothing if I click on a hyperlink in my Django app that resolves to that URL. I've also tried implementing it using the template - view protocol for Django but in my view neither of these seem to work return HttpResponse(html_filepath) or return render(request, html_filepath, context).

Returning HttpResponse simply displays the text file:///C:/my_dir/folder in my browser window at URL http://127.0.0.1:8000/my_app/my_dir/folder//result_filepath/.

Returning render gives the following error:

OSError at /my_app/C:/my_dir/folder//result_filepath/ [Errno 22] Invalid argument: 'C:\Users\user\Documents\my_app\my_source_code\my_tool\mysite\templates\file:\C:/my_dir/folder'

My goal is to see the folder contents at the URL file:///C:/my_dir/folder

over 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!