#36653: FORCE_SCRIPT_NAME is not respected for static URLs
-------------------------------------+------------------------------------
     Reporter:  Brian Helba          |                    Owner:  (none)
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  5.2
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by Jacob Walls):

 * cc: Florian Apolloner (added)
 * stage:  Unreviewed => Accepted

Comment:

 Thanks for the thorough report. Reproduced 👍

 Regression in 7dbbe65647a54283fadf2c51f11a750a74425d7b given the side
 effects left by the system check in step 4 and
 `django.contrib.staticfiles.utils.check_settings`, which does something
 similar.

 Reverting that commit fixes the `FORCE_SCRIPT_NAME` case; I would expect
 it to fix an invariant `SCRIPT_NAME` as well. I think triage on #34028
 missed this, since we can't just document that prefixes shouldn't be set
 outside the request/response cycle and expect this to work, since these
 two system checks are *also* outside the request/response cycle.

 See this comment
 [https://github.com/django/django/pull/13120#issuecomment-1405259988
 anticipating a revert] when someone posted on the closed PR, also
 encouraging us not to focus on varying values for `SCRIPT_NAME`:

 > There is an open ticket to that extend somewhere and I feel we might
 need to have to revert this. That said, settings are considered to be
 static, so if this changes per request Django will not be happy either way
 since the value was already passed to default_storage and used to
 instantiate the backend :/

 Would you like to submit a PR?
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36653#comment:8>
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/01070199de8c67aa-32d684c7-ef12-4492-a7c3-7eb65ca17279-000000%40eu-central-1.amazonses.com.

Reply via email to