Zidek / django-basic-apps

Automatically exported from code.google.com/p/django-basic-apps
0 stars 0 forks source link

upload_to is wrong on all FileField or ImageFields #21

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
upload_to should only be the part relative to MEDIA_ROOT and MEDIA_URL

so if MEDIA_ROOT is /foo/bar/ and you want files in /foo/bar/baz, upload_to
should only be 'baz' - no leading slashes or anything

by putting the full path in upload_to you're breaking everything for use in
getting the URL, since it tries to add the full filesystem path to
MEDIA_URL, and due to the leading slash it gets only the full filesystem path

Original issue reported on code.google.com by cgr...@gmail.com on 22 Oct 2008 at 10:13

GoogleCodeExporter commented 9 years ago
Correct me if I'm wrong but I'm not putting the full path in any upload_to 
fields. 

Original comment by npbor...@gmail.com on 17 Nov 2008 at 6:16

GoogleCodeExporter commented 9 years ago
trunk/media/models.py has a field where upload_to is using settings.MEDIA_ROOT 
in the 
value - I apologize for overstating the issue, but it is there :)

Original comment by cgr...@gmail.com on 17 Nov 2008 at 8:18

GoogleCodeExporter commented 9 years ago
Cool thanks for clarifying. Should be fixed now.

Original comment by npbor...@gmail.com on 17 Nov 2008 at 8:40