Opened 3 years ago

Last modified 3 years ago

#32304 closed Bug

Django adds spurious "/" prefix to settings.STATIC_URL="http://server/" — at Version 2

Reported by: Adam Hooper Owned by: nobody
Component: contrib.staticfiles Version: 3.1
Severity: Release blocker Keywords:
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 (last modified by Adam Hooper)

Here's a piece of settings from a totally reasonable, sensible, okay Docker integration-test environment

STATIC_URL = "http://minio/static/"

Django 3.1 will implicitly add "/" to the URL, so my URLs look like ""/http://minio/static/images/app-icons/favicon.ico".

The features and bugs that interact here:

  • commit c574bec, adding feature #25598, prepends SCRIPT_NAME to STATIC_URL when STATIC_URL isn't a URL.
  • bug #9202 and #25418: according to Django, "http://minio/static/" isn't a valid URL. (It is.)

Top me, the easiest fix is to address #9202 / #25418. Or to make STATIC_URL use some logic that is different from URLValidator.

Change History (2)

comment:1 by Adam Hooper, 3 years ago

Description: modified (diff)

comment:2 by Adam Hooper, 3 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top