Collectstatic error while deploying Django app to Heroku

前端 未结 10 1914
长情又很酷
长情又很酷 2020-12-04 06:34

I\'m trying to deploy a Django app to Heroku, it starts to build, download and installs everything, but that\'s what I get when it comes to collecting static files



        
10条回答
  •  遥遥无期
    2020-12-04 07:38

    I face same problem..

    Follow this step

    1. heroku config:set DISABLE_COLLECTSTATIC=1
    2. git push heroku master
    3. python manage.py collectstatic
    4. python manage.py test
    5. If any error occurred after running test..check your STATIC_ROOT is correct like this ==> STATIC_ROOT = os.path.join(BASE_DIR, 'static').
    6. After run collectstatic command check all static files are store in static directory for your root dir. level(manage.py dir. level)...
    7. heroku run python manage.py collectstatic.
    8. heroku run python manage.py migrate
    9. heroku config:unset DISABLE_COLLECTSTATIC (for future use).

提交回复
热议问题