I already have done collectstatic before, and it went well. Now I tried to deploy the app to Heroku, and got the error. It reproduces locally as well.
OSError: [Errno 63] File name too long: '/Users/admin/Desktop/Programming/Python/UkranianFunds/src/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/app/staticfiles/db.sqlite3'
I have my db.sqlite3 in gitignore if that matters.
Here is my settings:
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'staticfiles')
STATICFILES_DIRS = [
os.path.join(BASE_DIR), 'static'
]
My db.sqlite file is in the src directory. Not clear why collectstatic adds all these subfolders.
The solution was simple - I just deleted my staticfiles folder, and made collectstatic again - and it worked well.