I do not know why Django created a folder named staticfiles rather than static as expected. That might be the reason why I got an error after running python manage.py collectstatic:
The system cannot find the path specified: 'D:...\\static'
My settings file included:
from pathlib import Path
import os
import django_heroku
BASE_DIR = Path(__file__).resolve().parent.parent
STATIC_URL = '/static/'
STATICFILES_DIRS = (os.path.join(BASE_DIR, 'static'),)
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
I had already tried to change 'staticfiles' to 'static' in STATIC_ROOT, but no success.
Could anyone please explain why and how to create a folder name "static"?
Thank you very much in advance!
I considered your static files are placed inside your app(s)
Try removing
STATICFILES_DIRSso the setting will be:...and try to re-run
python manage.py collectstaticcollectstaticworks:STATICFILES_DIRSif any, if there is noSTATICFILES_DIRSin settings it collects static files from each appSTATIC_ROOT, so if your static files are placed inside your app(s) better to removeSTATICFILES_DIRSIf still there is an error share your project structure