[Django] #32175: FORCE_SCRIPT_NAME documentation doesn't explain how the prefix is prepended with regard to relative vs. absolute paths.

122 views
Skip to first unread message

Django

unread,
Nov 5, 2020, 10:35:31 AM11/5/20
to django-...@googlegroups.com
#32175: FORCE_SCRIPT_NAME documentation doesn't explain how the prefix is prepended
with regard to relative vs. absolute paths.
-----------------------------------------+-------------------------------
Reporter: MasonEgger | Owner: nobody
Type: Uncategorized | Status: new
Component: Documentation | Version: 3.1
Severity: Normal | Keywords: documentation
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 1
UI/UX: 0 |
-----------------------------------------+-------------------------------
When FORCE_SCRIPT_NAME is set it will prepend the prefix to URLs for
STATIC_URL and MEDIA_URL. However, if either the static root is an
absolute path (staring with a /) then this will be completely skipped.
Since Django defaults to STATIC_URL being set to `/static/` it is not
obvious that you may need to set this to be `STATIC_URL = "static/"`,
removing the leading slash.

The docs should have a note or warning in this section
https://docs.djangoproject.com/en/3.1/ref/settings/#force-script-name
explaining this.

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

Django

unread,
Nov 5, 2020, 10:49:20 PM11/5/20
to django-...@googlegroups.com
#32175: FORCE_SCRIPT_NAME documentation doesn't explain how the prefix is prepended
with regard to relative vs. absolute paths.
-------------------------------+----------------------------------------
Reporter: Mason Egger | Owner: Nayan sharma
Type: Uncategorized | Status: assigned
Component: Documentation | Version: 3.1
Severity: Normal | Resolution:

Keywords: documentation | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Nayan sharma):

* owner: nobody => Nayan sharma
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/32175#comment:1>

Django

unread,
Nov 6, 2020, 3:40:29 AM11/6/20
to django-...@googlegroups.com
#32175: FORCE_SCRIPT_NAME documentation doesn't explain how the prefix is prepended
with regard to relative vs. absolute paths.
-------------------------------+----------------------------------------
Reporter: Mason Egger | Owner: Nayan sharma
Type: Uncategorized | Status: closed
Component: Documentation | Version: 3.1
Severity: Normal | Resolution: invalid

Keywords: documentation | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+----------------------------------------
Changes (by Mariusz Felisiak):

* status: assigned => closed
* resolution: => invalid


Comment:

This behavior is already documented in
[https://docs.djangoproject.com/en/3.1/ref/settings/#media-url MEDIA_URL]
and [https://docs.djangoproject.com/en/3.1/ref/settings/#static-url
STATIC_URL] docs and it's not related with `FORCE_SCRIPT_NAME`, which is
only a way to override the server-provided value of `SCRIPT_NAME`.

--
Ticket URL: <https://code.djangoproject.com/ticket/32175#comment:2>

Reply all
Reply to author
Forward
0 new messages