Django

Code

Ticket #3417 (closed: wontfix)

Opened 2 years ago

Last modified 1 year ago

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

Reported by: henry.baldursson@gmail.com Assigned to: nobody
Milestone: Component: django.contrib.admin
Version: 0.95 Keywords:
Cc: Triage Stage: Design decision needed
Has patch: 1 Needs documentation: 1
Needs tests: 0 Patch needs improvement: 0

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

django-hb.diff (3.7 kB) - added by Henry Baldursson <henry.baldursson@gmail.com> on 02/02/07 07:11:47.
Patch for templatetags, relevant to 0.95.1 release

Change History

02/02/07 07:11:47 changed by Henry Baldursson <henry.baldursson@gmail.com>

  • attachment django-hb.diff added.

Patch for templatetags, relevant to 0.95.1 release

02/02/07 19:01:31 changed by Gary Wilson <gary.wilson@gmail.com>

  • needs_better_patch changed.
  • stage changed from Unreviewed to Design decision needed.
  • needs_tests changed.
  • needs_docs set to 1.

#2891 also talks about changing ADMIN_MEDIA_PREFIX.

08/03/07 15:15:12 changed by Collin Grady <cgrady@the-magi.us>

-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.

08/03/07 18:28:29 changed 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/'

08/03/07 18:37:54 changed by Collin Grady <cgrady@the-magi.us>

Ah, my mistake - carry on then :)

11/30/07 14:56:55 changed by jacob

  • status changed from new to closed.
  • resolution set to wontfix.

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).

11/30/07 15:05:08 changed by SmileyChris

  • status changed from closed to reopened.
  • resolution deleted.

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.

11/30/07 15:22:03 changed by jacob

  • status changed from reopened to closed.
  • resolution set to wontfix.

This just isn't worth it, sorry.

11/30/07 15:22:58 changed by SmileyChris

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


Add/Change #3417 (Admin interface template tags expect ADMIN_MEDIA_PREFIX to be a complete URL.)




Change Properties
Action