This is my model
class Informe(models.Model):
id_paciente = models.ForeignKey('Paciente')
id_medico = models.ForeignKey('Medico')
id_tecnico = models.ForeignKey('Tecnico')
contenido = models.FileField(upload_to='informes', verbose_name='informe')
def relative_path(self):
os.path.realpath(self.path, settings.MEDIA_ROOT)
I'm supoussed to download the txt file saved in /files/informes
. I can get without problems the url or the path in the template, but have no clue about how to being able to download it. How can I manage to, whenever the client clicks on the template's link, autodownload the file?
TIA!