[Answer]-How to get file relative path with pythons os – django python

1👍

Add a ‘/’ to tell the browser to start from the site’s root. Also, opening the link in a new window should be HTML:

<a href="/{{each}}" target="_blank">{{each}}</a>

Edit:

files = [os.path.join(dir, f) for f in files]

Leave a comment