Pregunta

I'm using grappelli and I have two files in it I need to modify:

admin/js/SelectBox.js
admin/js/SelectFilter2.js

I thought it would be a good idea to put it into my app static directory:

my_app/static/admin/js/SelectBox.js
my_app/static/admin/js/SelectFilter2.js

But whenever I try ./manage.py collectstatic files from my_app are overrided by original files from grappelli, however I need it vice versa.

I need just to add several strings in this files into existing functions, so I can't handle it within a new js files and include into Media class ( from my point of view ).

Is there any way to override grappelli files?

¿Fue útil?

Solución

To implement that, I had to order the installed apps in settings.py to put grappelli after my app, cause while collecting static files, if there are multiple files with the same name Django will pick the first one it finds. What that means is, unless you've changed STATICFILES_FINDERS, files inside folders in STATICFILES_DIRS will have the highest priority.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top