python_beg2
python_beg2

Reputation: 309

Django - Found another file with the destination path django - during deploying app

trying to deploy my app to uwsgi server

my settings file:

STATIC_ROOT = "/home/root/djangoApp/staticRoot/"

STATIC_URL = '/static/'

STATICFILES_DIRS = [
    os.path.join(BASE_DIR, "static"),
    '/home/root/djangoApp/static/',
]

and url file:

urlpatterns = [
    #urls
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

and if I try to execute the command:

python manage.py collectstatic

Then some files are okay ( admin files ), but I see an error next to files from static folder. The error is like:

Found another file with the destination path 'js/bootstrap.min.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.

and have no idea what can I do to solve it. Thanks in advance,

Upvotes: 0

Views: 3878

Answers (2)

Daniel Roseman
Daniel Roseman

Reputation: 599600

The two paths you have in STATICFILES_DIRS are the same. So Django copies the files from one of them, then goes on to the second and tries to copy them again, only to see the files already exist.

Remove one of those entries, preferably the second.

Upvotes: 1

A K
A K

Reputation: 798

do you have more than one application? If so, you should put any file on a subdirectory with a unique name (like the app name for example). collectstatic collects files from all the /static/ subdirectories, and if there is a duplication, it throw this error.

Upvotes: 0

Related Questions