(Disclaimer: this is a self-answered question)
I wanted to set up some Select2 to my form fields while in a Django admin panel (specifically in the change_list.html
template). So I added the neccesary scripts to the page (not the full version), but when it loads, I get this errors:
Select2: An instance of jQuery or a jQuery-compatible library was not found. Make
sure that you are including jQuery before Select2 on your web page.
TypeError: a is undefined
TypeError: e is undefined
TypeError: $ is not a function
And when you search for one of those errors (well, not the first and last ones), the answers aren't on the same subject (normally it has to do with a bad processResults
setup, or problems with Bootstrap) or in the docs neither.
How can I fix it?