Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3417 closed (wontfix)

Admin interface template tags expect ADMIN_MEDIA_PREFIX to be a complete URL.

Reported by: henry.baldursson@… Owned by: nobody
Component: contrib.admin Version: 0.95
Severity: Keywords:
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

The template tags for django.contrib.admin, when correcting the relative urls for static data, either expect settings.ADMIN_MEDIA_PREFIX to be a complete URL instead of prepending it with settings.MEDIA_URL.

I've created a patch affecting admin_list.py, admin_modify.py, and adminmedia.py.

Two things I'm not certain of, the affects the patch has on the adhoc javascript function SelectFilter in admin_modify.py, and also how it affects the functionality of having the development server serve static data.

Attachments (1)

django-hb.diff (3.7 KB) - added by Henry Baldursson <henry.baldursson@…> 8 years ago.
Patch for templatetags, relevant to 0.95.1 release

Download all attachments as: .zip

Change History (9)

Changed 8 years ago by Henry Baldursson <henry.baldursson@…>

Patch for templatetags, relevant to 0.95.1 release

comment:1 Changed 8 years ago by Gary Wilson <gary.wilson@…>

  • Needs documentation set
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Design decision needed

#2891 also talks about changing ADMIN_MEDIA_PREFIX.

comment:2 Changed 8 years ago by Collin Grady <cgrady@…>

-1 on this, as it then limits ADMIN_MEDIA_PREFIX to being in MEDIA_URL, when you may want different paths.

This may also create problems in runserver, due to the automatic mapping of the admin media.

comment:3 Changed 8 years ago by SmileyChris

Collin, I think you're missing what it does. If you use an absolute path for ADMIN_MEDIA_PREFIX, you'll see no change. It's just for if it's a relative path:

>>> from urlparse import urljoin

>>> urljoin('/media/', '/admin_media/')   # How most people have it - won't break anything
'/admin_media/'

>>> urljoin('/media/', 'admin/')   # What this patch will allow
'/media/admin/'

comment:4 Changed 8 years ago by Collin Grady <cgrady@…>

Ah, my mistake - carry on then :)

comment:5 Changed 8 years ago by jacob

  • Resolution set to wontfix
  • Status changed from new to closed

Marking wontfix -- this is how ADMIN_MEDIA_PREFIX is supposed to work. Also, it's simply too much of a backwards-incompatible change (for little reason).

comment:6 Changed 8 years ago by SmileyChris

  • Resolution wontfix deleted
  • Status changed from closed to reopened

I'm not exactly passionate about this ticket, but how is this backwards-incompatible? Current if you've got an absolute path for ADMIN_MEDIA_PREFIX (like everyone currently does) there is no change to behaviour.

All this introduces is new functionality of allowing the use of a relative path as your ADMIN_MEDIA_PREFIX.

comment:7 Changed 8 years ago by jacob

  • Resolution set to wontfix
  • Status changed from reopened to closed

This just isn't worth it, sorry.

comment:8 Changed 8 years ago by SmileyChris

Fair enough, just wanted to get a valid close reason ;)

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