Search code examples
djangoherokuweb-deploymentdjango-staticfiles

Problem in collecting static files when deploying a Django Web App to Heroku


Images

I've tried deploying my Django web app to Heroku but it's having some problems with collecting the static files, it looks it can't find the image that's being referred to by a css file.

My settings.py file

STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles')
STATIC_URL = '/static/'
 
django_heroku.settings(locals())

What am I doing wrong here? and what should I do? I used the AdminLTE bootstrap theme.


Solution

  • I too had a similiar case, try to run collectstatic in your django project. It shows the same error. Please go the css file and delete the missing image or make sure if you have the missed file in path and run collectstatic once again.If it works in your proj then it will deploy perfectly.

    Thank you.