Static files on OpenShift Django

前端 未结 5 1684
悲&欢浪女
悲&欢浪女 2020-12-16 06:59

I\'m having issues serving up static files - i.e. style sheets and images required from my html pages. I cannot seem to fathom why these static images are not being found. H

5条回答
  •  Happy的楠姐
    2020-12-16 07:23

    Me also had the same problem with Heroku. Static files are not served correctly.

    Then i figured out every time when i deploy the application to heroku background its performing collectstatic. But i didnt mention STATIC_ROOT in settings.py.

    So i put static root like this

    STATIC_ROOT = 'staticfiles'
    

    Then i deployed that time its working. Try that out in openshift and let me know

提交回复
热议问题