Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

312
Vistas
In django: Problems with loading jquery with multiple plugins - or: How to load jQuery only once?

I use django (1.8.16) with a ton of plugins ("apps"). Some are:

  • django-ckeditor==4.5.1
  • django-image-cropping==1.0.3
  • django.contrib.admin
  • django-jquery==3.1.0

I want to use django autocomplete-light (dal for short) (3.2.1, current version) in the admin interface. Now I have the following jquery struggle. dal uses jquery but does not load it itself. It leaves it up to the developer. dal comes with a script "select2.js" registering a function under $.select2.

Now the problem. When a plugin like ckeditor or image-cropping loads jquery the function $.select2 is not reachable any more.

I have created a bug report over at dal but one dev says it is my responsability to load jquery first.

So, how do I load jquery, load it before dal needs it and load it only once?

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Per the django-ckeditor docs:

If you have jQuery loaded from a different source just don't set [CKEDITOR_JQUERY_URL] and django-ckeditor will not try to load its own jQuery.

You should make sure you're setting all apps that could load jQuery to not load it, similar to above. Then, use django-jquery to load jquery, making sure that jQuery is available in the console (i.e., try typing console.log($) to see if it's available). Make sure that you put your jQuery template tag above any other template tags loaded by the other libraries.

This should solve any conflicts you're experiencing.

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda