i want to concatenate string and variable in views.py file.
i tried {{}} but this is not working on views.py file.
try:
filename= file.cv #file name comes from db
path = "media/" filename
return FileResponse(open("path, 'rb'), content_type='application/pdf')
except FileNotFoundError:
raise Http404()
i need to save a string in path variable like "media/cv.pdf" or "media/mycv.pdf" but can't do that.
path = "media/" + filenameorpath = os.path.join("media", filename)