#36562: `StaticFilesStorage` should respect `base_url` and treat `STATIC_URL`
as a
fallback
-------------------------------------+-------------------------------------
Reporter: Kamil Paduszyński | Owner: (none)
Type: Bug | Status: closed
Component: contrib.staticfiles | Version: 5.2
Severity: Normal | Resolution: wontfix
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 Natalia Bidart):
* resolution: => wontfix
* status: new => closed
Comment:
Replying to [comment:3 Kamil Paduszyński]:
Thanks for the follow up and the extra details. After reviewing this I
think this should be closed as `wontfix`. A few points:
* The `StaticFilesHandler` is for development only. It is the helper that
`runserver` uses when `DEBUG=True`. In production you should always serve
static files with a proper web server or CDN or similar. The handler
itself is undocumented, which is a sign it is an internal detail and not
part of the public API.
* The handler has no direct relation to the storage backend. The storage
controls where files are stored and what URLs are returned. The handler is
a WSGI wrapper that serves requests. They both care about static files but
they are independent..
* The parallel you mention between `FileSystemStorage` and
`StaticFilesStorage` does not apply here for handlers. There is no
''handler version'' of each storage, they are different layers.
Because of the above, making the handler honor the `base_url` from storage
does not seem right. It would blur two separate concepts and could confuse
the setup. Keeping `STATIC_URL` as the single knob that the handler checks
is simpler and keeps the dev helper separated from storage configuration.
--
Ticket URL: <https://code.djangoproject.com/ticket/36562#comment:4>
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 visit
https://groups.google.com/d/msgid/django-updates/01070198e676f3b1-63c68fbd-7c71-4742-a20c-d04a2ff9be7c-000000%40eu-central-1.amazonses.com.