Opened 3 years ago

Closed 3 years ago

Last modified 3 years 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 by Mariusz Felisiak, 3 years ago

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 by Mariusz Felisiak, 3 years ago

Cc: Florian Apolloner added

comment:3 by Markus Holtermann, 3 years ago

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 by Markus Holtermann, 3 years ago

Needs documentation: unset

comment:5 by Mariusz Felisiak, 3 years ago

Triage Stage: AcceptedReady for checkin

comment:6 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

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 by Mariusz Felisiak <felisiak.mariusz@…>, 3 years ago

In 50a5f88:

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

comment:8 by GitHub <noreply@…>, 3 years ago

In 3fa1ed5:

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

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