Opened 16 months ago

Closed 16 months ago

Last modified 15 months ago

#32394 closed Cleanup/optimization (fixed)

Adjust project template to leverage automatic SCRIPT_NAME prefix for STATIC_URL

Reported by: Markus Holtermann Owned by: Markus Holtermann
Component: contrib.staticfiles Version: dev
Severity: Normal Keywords: script_name static_url media_url
Cc: Florian Apolloner Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (8)

comment:1 Changed 16 months ago by Mariusz Felisiak

Has patch: set
Needs documentation: set
Severity: Release blockerNormal
Triage Stage: UnreviewedAccepted
Version: 3.1master

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

PR

comment:2 Changed 16 months ago by Mariusz Felisiak

Cc: Florian Apolloner added

comment:3 Changed 16 months ago 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

comment:4 Changed 16 months ago by Markus Holtermann

Needs documentation: unset

comment:5 Changed 16 months ago by Mariusz Felisiak

Triage Stage: AcceptedReady for checkin

comment:6 Changed 16 months ago by Mariusz Felisiak <felisiak.mariusz@…>

Resolution: fixed
Status: assignedclosed

In 9d05add:

Fixed #32394 -- Changed project template settings to use relative STATIC_URL.

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

comment:7 Changed 16 months ago by Mariusz Felisiak <felisiak.mariusz@…>

In 50a5f88:

Refs #32394 -- Changed STATIC_URL/MEDIA_URL to relative paths in tests and docs where appropriate.

comment:8 Changed 15 months ago by GitHub <noreply@…>

In 3fa1ed5:

Refs #32394 -- Rephrased release note for STATIC_URL change.

Note: See TracTickets for help on using tickets.
Back to Top