Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I update jquery version in django admin

How can I update jquery version in Django admin? Without replacing it in django/contrib/admin/media/js/admin/ jquery.min.js To newest jquery.min.js. Also I don't want to use two versions of jquery in my admin.

like image 523
Eugene Nagorny Avatar asked Feb 02 '23 09:02

Eugene Nagorny


1 Answers

That's your only two options. You're right about changing the actual Django file being a bad idea, so the only other option is to load your own in addition to that.

The Django version of jQuery is already namespaced as django.jQuery, so you can load your own version of jQuery with or without jQuery.noConflict().

I understand you feelings toward running two versions of jQuery on the same page, but this is the admin site, not your user-facing website. It's not that much of a speed cost loading the library twice, but it will only even be applicable to the handle of users (or maybe just yourself) who use the admin.

like image 111
Chris Pratt Avatar answered Feb 05 '23 15:02

Chris Pratt