Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add model method that gives path to file with MEDIA_DIR prepended. #59

Open
flowl opened this issue Jun 25, 2019 · 2 comments
Open

Add model method that gives path to file with MEDIA_DIR prepended. #59

flowl opened this issue Jun 25, 2019 · 2 comments

Comments

@flowl
Copy link

flowl commented Jun 25, 2019

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?

@bartTC
Copy link
Owner

bartTC commented Jun 25, 2019

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 }}"...

@bartTC
Copy link
Owner

bartTC commented Jun 25, 2019

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.

@flowl flowl closed this as completed Jul 6, 2019
@bartTC bartTC reopened this Jul 6, 2019
@bartTC bartTC changed the title Upload and Download path differ Add model method that gives path to file with MEDIA_DIR prepended. Jul 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants