Your call to
".format(file_name)"
does nothing as the original string does not have the positional arguments
("{0}" for example)
You could just append the filename with "+".
On Mon, Feb 2, 2015 at 3:32 AM, John wrote:
> Hello everyone,
>
> I am trying to run this code inside view.py, to make
Hello everyone,
I am trying to run this code inside view.py, to make PDF file able to be
downloaded :
> import os
> BASE_DIR = os.path.dirname(os.path.dirname(__file__))def
> download(request, file_name = 'article1'):
> file = open(os.path.join(BASE_DIR,
> 'media').replace('\\','/'
2 matches
Mail list logo