bartTC / django-attachments

A generic Django application to attach Files (Attachments) to any model.
BSD 3-Clause "New" or "Revised" License
296 stars 90 forks source link

Error on click to attachment download link #95

Closed Maudal78 closed 1 year ago

Maudal78 commented 1 year ago

Dear, thanks for the application, very usefull and good. can someone help me, I have all working with tags, load attachemnt save on media directory but when I click on download link it send

expected str, bytes or os.PathLike object, not NoneType

delete link is working on file deletion database.

here my settings BASE_DIR => /home/workspace/sgm_maudal STATIC_URL => /manutenzione/static/ STATIC_ROOT => /home/workspace/sgm_maudal/manutenzione/static MEDIA_ROOT => /home/workspace/sgm_maudal/media MEDIA_URL => /media/

immagine

immagine

It worked many times and after, when I add qr-code with pip installation get the erro. I dont think problem is qr-code, may be my mistake.

Thanks regards

Maudal78 commented 1 year ago

solved by set

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(file))) TEMPLATE_DIR = os.path.join(BASE_DIR, 'templates') STATIC_DIR = os.path.join(BASE_DIR, 'static') MEDIA_DIR = os.path.join(BASE_DIR, 'media') LOG_DIR = os.path.join(BASE_DIR, 'logs')