#32991: Change in behavior of FileField.url between versions 2.2.16 -> 3.2.5;
returned 'relative' value contains leading slash
-------------------------------------+-------------------------------------
     Reporter:  Elchin Mammadov      |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  contrib.staticfiles  |                  Version:  3.2
     Severity:  Normal               |               Resolution:  invalid
     Keywords:  FileField.url        |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Florian Apolloner):

 It is true that it is the default value but that was never a useful value
 to begin with if you deployed your site. Assume the following (with the
 default `MEDIA_ROOT`): you are on page http://example.com/sub1/sub2 and
 request the URL of `my_image.jpg` which would yield
 `photos/123/my_image.jpg`. Putting that into an `<img>` tag would result
 in a final URL of http://example.com/sub1/sub2/photos/123/my_image.jpg. Do
 the same on http://example.com/sub3 instead and you'd get
 http://example.com/sub3/photos/123/my_image.jpg. So how did you ever serve
 your images with this setup?

-- 
Ticket URL: <https://code.djangoproject.com/ticket/32991#comment:5>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/066.91d114ce10691d014861a104530f22f1%40djangoproject.com.

Reply via email to