#30745: Allow serving a default file for FileField from static URL.
-------------------------------------+-------------------------------------
Reporter: bhch | Owner: nobody
Type: New feature | Status: closed
Component: File | Version: 2.2
uploads/storage |
Severity: Normal | Resolution: needsinfo
Keywords: | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):
* status: new => closed
* resolution: => needsinfo
Comment:
I suspect the best approach here is to just use an known default relative
to `STATIC_URL` — so instead of `/static/placeholder.png`, just
`placeholder.png`, allowing `urljoin()` to do it's thing? (Does that not
work for you? If not, I'd try overriding the `url` property on the field
to handle the default case before thinking about adjusting the storage...)
Given the sensitive nature of this, any change here will need to go via a
full proposal to the DevelopersMailingList. I'm guessing this isn't
something we'd be keen to change but we'd need to see exactly what's being
proposed, and exactly how we can be sure we're not introducing a security
regression before moving forwards. (Test cases showing that the `re` is
correct for all manner of cases being at least a starting point there.)
I'll mark it `needsinfo` on that basis.
--
Ticket URL: <https://code.djangoproject.com/ticket/30745#comment:1>
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/062.3b25e30687905d4011aadbd44297e764%40djangoproject.com.