Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Found another file with the destination path - where is that other file?

Tags:

python

django

When running manage.py collectstatic in Django, I see messages like:

Found another file with the destination path 'admin/js/jquery.init.js'. It will be ignored since only the first encountered file is collected. If this is not what you want, make sure every static file has a unique path.

I tried running find . -type l to search for symbolic links in my Django project, but it didn't turn up anything.

How can I figure out where the other file with the same destination path is?

like image 541
Thomas Johnson Avatar asked Feb 23 '16 07:02

Thomas Johnson


3 Answers

check this: https://github.com/django-compressor/django-compressor/issues/720

STATICFILES_FINDERS = (
    'django.contrib.staticfiles.finders.FileSystemFinder',
    #'django.contrib.staticfiles.finders.AppDirectoriesFinder',    #causes verbose duplicate notifications in django 1.9
)
like image 114
You knows who Avatar answered Oct 29 '22 00:10

You knows who


Django respects the order of your apps in settings.py INSTALLED_APPS when running collectstatic.

If you have two installed apps that write the same static files (e.g. django.contrib.admin and grappelli) then Django collectstatic will write the static files for the app appearing first in the list. When it hits the second app it will ignore its static files and output the warning you are seeing.

So you need to find out which two INSTALLED_APPS are trying to write the same static files, and decide which one you want to use the static files of. If you make sure that app appears first in your INSTALLED_APPS list then you can safely ignore the warnings generated from the second app.

like image 41
galarant Avatar answered Oct 29 '22 00:10

galarant


Like templates, static files are searched for in two locations:

  1. under the directories listed in STATIC_DIRS
  2. in static directories in the apps themselves.

In this case, it looks like this file is provided both by django/contrib/admin/static, and /static/.

like image 10
Daniel Roseman Avatar answered Oct 28 '22 23:10

Daniel Roseman