dldevinc/django-spectrum

Throws "django is not defined" Javascript error in browser console

Closed this issue · 2 comments

Python 3.6
Django 2.1.8
wagtail 2.4

The widget does not initialize in admin and throws a "django is not defined" error in browser console. I traced it back to the last line of venv/lib/python3.6/site-packages/spectrum/static/spectrum/js/widget.js

which is

})(django.jQuery || jQuery);

Apparently the django global object is not available in this context so replacing it with

})(jQuery);

makes the error go away.

Hi, @ejazrasool.
I've just released a new version 0.5.2, which is working with Wagtail. Could you please confirm that everything is ok?

Hi @pix666
Just tested the version and I can confirm that the latest version works in my setup. Thanks a lot for the quick resolution :)