I wanted to make several files available to download for the users. I tried it like this but Django tries to open this url:
http://10.0.3.186:8000/var/www/openvpn/examples/easy-rsa/2.0/keys/first_key.key
I changed my template line like this:
<td width="100%" align = "right">
<a href="http://10.0.3.186:8000/sslcert/{{ file }}/key_download">
<font color = "white">  SSL-Key  </font>
</a>
</td>
I added following line to my urls
url(r'^(?P<username>\w+)/key_download$', views.key_download, name='key_download')
My views look like this
from django.utils.encoding import smart_str
def key_download(request, username):
username_key = username + ".key"
response = HttpResponse(mimetype='application/force-download')
response['Content-Disposition'] = 'attachment; filename=%s' % smart_str(username_key)
response['X-Sendfile'] = smart_str("/var/www/openvpn/examples/easy-rsa/2.0/keys")
return response
The file is getting downloaded and the filename is the right one, BUT it doesn't show any content at the moment.