Deprecating ADMIN_MEDIA_PREFIX

23 views
Skip to first unread message

Carl Meyer

unread,
Nov 20, 2010, 9:52:49 PM11/20/10
to Django developers
Hi all,

The special-cased handling of contrib.admin static assets in Django
core is a long-time wart. Fortunately, the new static assets standard
introduced by contrib.staticfiles and the STATIC_URL and STATIC_ROOT
settings finally allows us to begin a migration path to remove this
wart. AdminMediaHandler is already on a deprecation path; the
remaining piece is the ADMIN_MEDIA_PREFIX setting.

After discussion with Jannis on IRC, we have a plan for deprecating
ADMIN_MEDIA_PREFIX. The expectation is now that any apps' static
assets should be found at STATIC_URL/appname. The idea is to introduce
a check whether ADMIN_MEDIA_PREFIX is equal to STATIC_URL/admin, and
if it is not, raise a (pending) deprecation warning and alert the user
that in a future release of Django, the ADMIN_MEDIA_PREFIX setting
will be removed, and the admin media will be assumed to be served at
STATIC_URL/admin.

Any objections to this plan before I put it into action?

Carl

Russell Keith-Magee

unread,
Nov 21, 2010, 2:41:21 AM11/21/10
to django-d...@googlegroups.com

No objections from me. Removing the special case of Admin media is a natural thing to do now that we have a media handling framework.

The only kink in the plan that I can see is the loss of flexibility in being able to deploy admin media anywhere you want, independent of other site media. However, I don't think this is a loss that should concern us.

Yours,
Russ Magee %-)

Andrew Godwin

unread,
Nov 21, 2010, 4:23:04 PM11/21/10
to django-d...@googlegroups.com

+1 from me; sounds like a good plan. The whole
admin-media-special-case-thing has been a bit of a wart from the start.

Andrew

hejsan

unread,
Nov 25, 2010, 7:22:11 PM11/25/10
to Django developers
In the future, how would we specify a different path for admin media?

There is the case of the "same origin policy" that makes me jump
through hoops to make sure that any javascript and/or iframe based
goodies, such as tinymce are served from the same domain.
Reply all
Reply to author
Forward
0 new messages