Django 2.2 and custom media in the admin

78 views
Skip to first unread message

Thorsten Sanders

unread,
Apr 9, 2019, 11:02:35 AM4/9/19
to Django users
Hello,

I insert a custom javascript inside the admin and do use the "django.jquery" this worked fine until updating to Django 2.2.

With 2.2 the order in which the javascripts are loaded changed and the jquery.init.js is now loaded after my custom javascript, is that considered a bug or a change?

Regards,
Thorsten

Simon Charette

unread,
Apr 9, 2019, 5:14:25 PM4/9/19
to Django users
Hello Thorsten, this is a change document in the 2.2 release notes[0].

There's even a resolution example for a django.jQuery dependency like you have

> For example, widgets depending on django.jQuery must specify
> js=['admin/js/jquery.init.js', ...] when declaring form media assets. [1]

Cheers,
Simon

Thorsten Sanders

unread,
Apr 10, 2019, 4:14:21 AM4/10/19
to django...@googlegroups.com

Hello,

thanks did overread that twice then, once when reading changes, once when trying to figure out if there was a change due not working.
Then i searched for it and came to:

https://docs.djangoproject.com/en/2.2/ref/contrib/admin/#jquery

Maybe not bad idea to mention it there too.

Regards,
Thorsten

Am 09.04.19 um 23:14 schrieb Simon Charette:
--
You received this message because you are subscribed to a topic in the Google Groups "Django users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/django-users/scJvRttmQZY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/018ab123-2b22-4425-bb6d-efeb1c4f12cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages