django-attachments
django-attachments copied to clipboard
Add model method that gives path to file with MEDIA_DIR prepended.
Images get uploaded to
STATIC_DIR + /attachments/module_entity/73630/image.jpg
But when getting displayed, the static/media prefix is not respected and it loads the image from
attachments/module_entity/73630/image.jpg => 404
Sidequestion: Is there a variable to configure to use the current logged in user instead of presenting a selectbox to chose the upload user from?
STATIC_DIR looks wrong, it should land in your MEDIA_DIR. Currently you need to prepend the MEDIA_URL manually. So something along
<a href="/uploads/{{ att.attachment_file.url }}"...
Is there a variable to configure to use the current logged in user instead of presenting a selectbox to chose the upload user from?
You mean in the admin integration? No. The admin part is primarily for maintanance, not intended to have regular users/editors add files through it. If thats your only entry point then you probably don't need this app and can build it on your own.
Overriding the admin and having it behave that way is not that complicated though.