Opened 18 years ago

Closed 17 years ago

Last modified 17 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: no UI/UX: no

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@…> 18 years ago.
Patch for templatetags, relevant to 0.95.1 release

Download all attachments as: .zip

Change History (9)

by Henry Baldursson <henry.baldursson@…>, 18 years ago

Attachment: django-hb.diff added

Patch for templatetags, relevant to 0.95.1 release

comment:1 by Gary Wilson <gary.wilson@…>, 18 years ago

Needs documentation: set
Triage Stage: UnreviewedDesign decision needed

#2891 also talks about changing ADMIN_MEDIA_PREFIX.

comment:2 by Collin Grady <cgrady@…>, 17 years ago

-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 by Chris Beaven, 17 years ago

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 by Collin Grady <cgrady@…>, 17 years ago

Ah, my mistake - carry on then :)

comment:5 by Jacob, 17 years ago

Resolution: wontfix
Status: newclosed

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 by Chris Beaven, 17 years ago

Resolution: wontfix
Status: closedreopened

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 by Jacob, 17 years ago

Resolution: wontfix
Status: reopenedclosed

This just isn't worth it, sorry.

comment:8 by Chris Beaven, 17 years ago

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

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