A questionale developer had added exraneous code to image URLS that used to work. I would be gratefuldor your assitamce please?

24 views
Skip to first unread message

KarmaFish

unread,
Sep 9, 2018, 6:47:23 PM9/9/18
to Django users
Hello we  had no issues uploaded images to our servers pointing toa n image name.
But this Dev came in and changed the code.
Whenever we upload a new image for a product, after save , we'd go back to find that the image name had an automatically generated code added to the jpg filename making the image blank.

Where can I fix that please? Remove that superfluous random numbers please?

Thank you in advance,

random.jpg


mottaz hejaze

unread,
Sep 9, 2018, 7:06:59 PM9/9/18
to django...@googlegroups.com
please share code ..

Is this image from admin panel or from website front ..

please share models.py , admin.py , views.py and forms.py 
 



--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/eb34f554-04c8-487a-a03b-020a48e0bd14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Vijay Khemlani

unread,
Sep 9, 2018, 8:32:10 PM9/9/18
to django...@googlegroups.com
If you're using django-storages with S3 as the media backend then there is a setting called AWS_S3_FILE_OVERWRITE that prevents files with the same name form being uploaded. In those cases the library appends a suffix similar to your example.

Usually this is useful to prevent files from being overwritten (for example if you upload photos for different products with the same filename you don't want one to overwrite the other)

Reply all
Reply to author
Forward
0 new messages