[Django] #32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for STATIC_URL

43 views
Skip to first unread message

Django

unread,
Jan 29, 2021, 9:09:00 AM1/29/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus | Owner: Markus Holtermann
Holtermann |
Type: | Status: assigned
Cleanup/optimization |
Component: | Version: 3.1
contrib.staticfiles |
Severity: Release | Keywords: script_name
blocker | static_url media_url
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
With #25598, Django will prefix the values of `STATIC_URL` and `MEDIA_URL`
with `SCRIPT_NAME` if they are relative. For users to leverage this
feature, they will need to adjust the `STATIC_URL` included in the
settings.py and remove the leading `/`. I propose to remove the leading
`/` from the project template to let users benefit from the change right
away.

Since the change doesn't affect existing projects, this is fully backwards
compatible.

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

Django

unread,
Jan 29, 2021, 12:19:14 PM1/29/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: script_name | Triage Stage: Accepted
static_url media_url |
Has patch: 1 | Needs documentation: 1

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* needs_docs: 0 => 1
* has_patch: 0 => 1
* version: 3.1 => master
* severity: Release blocker => Normal
* stage: Unreviewed => Accepted


Comment:

Thanks. I don't see why this should be a release blocker.

[https://github.com/django/django/pull/13951 PR]

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

Django

unread,
Jan 29, 2021, 12:25:19 PM1/29/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: script_name | Triage Stage: Accepted
static_url media_url |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* cc: Florian Apolloner (added)


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

Django

unread,
Jan 29, 2021, 2:39:04 PM1/29/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: script_name | Triage Stage: Accepted
static_url media_url |
Has patch: 1 | Needs documentation: 1
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Markus Holtermann):

Sorry about the release blocker flag. I've misinterpreted when the
original feature was released. I had thought it was added in 3.2

--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:3>

Django

unread,
Jan 29, 2021, 2:48:03 PM1/29/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: script_name | Triage Stage: Accepted
static_url media_url |
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Markus Holtermann):

* needs_docs: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:4>

Django

unread,
Feb 6, 2021, 7:44:25 AM2/6/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: assigned
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution:
Keywords: script_name | Triage Stage: Ready for
static_url media_url | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:5>

Django

unread,
Feb 6, 2021, 2:13:14 PM2/6/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed

Keywords: script_name | Triage Stage: Ready for
static_url media_url | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"50a5f8840fa564dcefdb1fa5c58f06fcd472ee70" 50a5f88]:
{{{
#!CommitTicketReference repository=""
revision="50a5f8840fa564dcefdb1fa5c58f06fcd472ee70"
Refs #32394 -- Changed STATIC_URL/MEDIA_URL to relative paths in tests and
docs where appropriate.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:7>

Django

unread,
Feb 6, 2021, 2:13:15 PM2/6/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed
Keywords: script_name | Triage Stage: Ready for
static_url media_url | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

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


Comment:

In [changeset:"9d05add447d57d94ec9e9b3daa338d85a29fe083" 9d05add]:
{{{
#!CommitTicketReference repository=""
revision="9d05add447d57d94ec9e9b3daa338d85a29fe083"
Fixed #32394 -- Changed project template settings to use relative
STATIC_URL.

Refs #25598 which added original support for relative STATIC_URL and
MEDIA_URL.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:6>

Django

unread,
Feb 13, 2021, 2:08:22 PM2/13/21
to django-...@googlegroups.com
#32394: Adjust project template to leverage automatic SCRIPT_NAME prefix for
STATIC_URL
-------------------------------------+-------------------------------------
Reporter: Markus Holtermann | Owner: Markus
Type: | Holtermann
Cleanup/optimization | Status: closed
Component: contrib.staticfiles | Version: master
Severity: Normal | Resolution: fixed
Keywords: script_name | Triage Stage: Ready for
static_url media_url | checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by GitHub <noreply@…>):

In [changeset:"3fa1ed53be370f4b1a94d78b56ff30d23b131623" 3fa1ed5]:
{{{
#!CommitTicketReference repository=""
revision="3fa1ed53be370f4b1a94d78b56ff30d23b131623"
Refs #32394 -- Rephrased release note for STATIC_URL change.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/32394#comment:8>

Reply all
Reply to author
Forward
0 new messages