Manage CSS/JS files in admin views.

7 views
Skip to first unread message

jedie

unread,
Jan 29, 2010, 7:13:59 AM1/29/10
to Django developers
I notice that jQuery comes into django with http://code.djangoproject.com/changeset/12297

In my own project i already have jQuery saved in my own media dir and
i added in my own /admin/base_site.html file. So in some admin views i
have two jQuery included. That's not really good.

Managing CSS/JS files in the admin views should be reconsidered. But i
have not a solution for this, now :(

Ideas?

Mfg.

Jens

Jannis Leidel

unread,
Jan 29, 2010, 9:53:52 AM1/29/10
to django-d...@googlegroups.com
Hi Jedie,

> In my own project i already have jQuery saved in my own media dir and
> i added in my own /admin/base_site.html file. So in some admin views i
> have two jQuery included.

Isn't Django's media handling capable to help in case you want to use your own version of a JavaScript file shipped with Django? http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-media-definitions

Jannis

patrickk

unread,
Jan 29, 2010, 10:47:20 AM1/29/10
to Django developers
@jannis: no, it isn´t. I thinkg you are able to _add_ js to your admin
views, but you´re not able to _remove_ javascripts. there´s still way
too much hardcoded stuff with the admin-interface (IMO).

I hope that including jquery with the admin-interface is not a big
mistake in the long run.

regards,
patrick

> Isn't Django's media handling capable to help in case you want to use your own version of a JavaScript file shipped with Django?http://docs.djangoproject.com/en/dev/ref/contrib/admin/#modeladmin-me...
>
> Jannis

Russell Keith-Magee

unread,
Jan 29, 2010, 10:52:58 AM1/29/10
to django-d...@googlegroups.com
On Fri, Jan 29, 2010 at 11:47 PM, patrickk <pat...@vonautomatisch.at> wrote:
> @jannis: no, it isn´t. I thinkg you are able to _add_ js to your admin
> views, but you´re not able to _remove_ javascripts. there´s still way
> too much hardcoded stuff with the admin-interface (IMO).
>
> I hope that including jquery with the admin-interface is not a big
> mistake in the long run.

Then it's our job to make sure it isn't. Admin clearly benefits from
having a richer javascript toolkit to work with. If we need to improve
the media framework to avoid a particular type of javascript reuse
problem, then that's what we need to do. You don't fix a problem by
hobbling functionality.

Yours,
Russ Magee %-)

Reply all
Reply to author
Forward
0 new messages