When I tried to upload a file, my page shows this:
'ascii' codec can't encode character u'\xc1' in position 51: ordinal not in range(128)
os.stat(path)
u'/opt/djangoproject/ConvocatoriaESCA/media_cdn/Luis \xc1ngel Garc\xeda Ramos/Comprobante_Ingl\xe9s_Luis_\xc1ngel_Garc\xeda_Ramos.pdf'
My path to upload Files in models.py have:
def upload_location_comprobante_ingles(instance, filename):
filename = u"Comprobante_Inglés %s %s.pdf" % (instance.nombre, instance.apellidos)
return u"%s %s/%s" % (instance.nombre, instance.apellidos, filename)
and nombre and apellidos are UTF-8 strings